@@ -20,7 +20,7 @@ public class RoleStore<TRole> : RoleStore<TRole, DbContext, string>
20
20
/// </summary>
21
21
/// <param name="context">The <see cref="DbContext"/>.</param>
22
22
/// <param name="describer">The <see cref="IdentityErrorDescriber"/>.</param>
23
- public RoleStore ( DbContext context , IdentityErrorDescriber describer = null ) : base ( context , describer ) { }
23
+ public RoleStore ( DbContext context , IdentityErrorDescriber ? describer = null ) : base ( context , describer ) { }
24
24
}
25
25
26
26
/// <summary>
@@ -37,7 +37,7 @@ public class RoleStore<TRole, TContext> : RoleStore<TRole, TContext, string>
37
37
/// </summary>
38
38
/// <param name="context">The <see cref="DbContext"/>.</param>
39
39
/// <param name="describer">The <see cref="IdentityErrorDescriber"/>.</param>
40
- public RoleStore ( TContext context , IdentityErrorDescriber describer = null ) : base ( context , describer ) { }
40
+ public RoleStore ( TContext context , IdentityErrorDescriber ? describer = null ) : base ( context , describer ) { }
41
41
}
42
42
43
43
/// <summary>
@@ -58,7 +58,7 @@ public class RoleStore<TRole, TContext, TKey> : RoleStore<TRole, TContext, TKey,
58
58
/// </summary>
59
59
/// <param name="context">The <see cref="DbContext"/>.</param>
60
60
/// <param name="describer">The <see cref="IdentityErrorDescriber"/>.</param>
61
- public RoleStore ( TContext context , IdentityErrorDescriber describer = null ) : base ( context , describer ) { }
61
+ public RoleStore ( TContext context , IdentityErrorDescriber ? describer = null ) : base ( context , describer ) { }
62
62
}
63
63
64
64
/// <summary>
@@ -83,7 +83,7 @@ public class RoleStore<TRole, TContext, TKey, TUserRole, TRoleClaim> :
83
83
/// </summary>
84
84
/// <param name="context">The <see cref="DbContext"/>.</param>
85
85
/// <param name="describer">The <see cref="IdentityErrorDescriber"/>.</param>
86
- public RoleStore ( TContext context , IdentityErrorDescriber describer = null )
86
+ public RoleStore ( TContext context , IdentityErrorDescriber ? describer = null )
87
87
{
88
88
if ( context == null )
89
89
{
@@ -211,7 +211,7 @@ protected virtual async Task SaveChanges(CancellationToken cancellationToken)
211
211
{
212
212
throw new ArgumentNullException ( nameof ( role ) ) ;
213
213
}
214
- return Task . FromResult ( ConvertIdToString ( role . Id ) ) ;
214
+ return Task . FromResult ( ConvertIdToString ( role . Id ) ! ) ;
215
215
}
216
216
217
217
/// <summary>
@@ -220,7 +220,7 @@ protected virtual async Task SaveChanges(CancellationToken cancellationToken)
220
220
/// <param name="role">The role whose name should be returned.</param>
221
221
/// <param name="cancellationToken">The <see cref="CancellationToken"/> used to propagate notifications that the operation should be canceled.</param>
222
222
/// <returns>A <see cref="Task{TResult}"/> that contains the name of the role.</returns>
223
- public virtual Task < string > GetRoleNameAsync ( TRole role , CancellationToken cancellationToken = default ( CancellationToken ) )
223
+ public virtual Task < string ? > GetRoleNameAsync ( TRole role , CancellationToken cancellationToken = default ( CancellationToken ) )
224
224
{
225
225
cancellationToken . ThrowIfCancellationRequested ( ) ;
226
226
ThrowIfDisposed ( ) ;
@@ -238,7 +238,7 @@ protected virtual async Task SaveChanges(CancellationToken cancellationToken)
238
238
/// <param name="roleName">The name of the role.</param>
239
239
/// <param name="cancellationToken">The <see cref="CancellationToken"/> used to propagate notifications that the operation should be canceled.</param>
240
240
/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns>
241
- public virtual Task SetRoleNameAsync ( TRole role , string roleName , CancellationToken cancellationToken = default ( CancellationToken ) )
241
+ public virtual Task SetRoleNameAsync ( TRole role , string ? roleName , CancellationToken cancellationToken = default ( CancellationToken ) )
242
242
{
243
243
cancellationToken . ThrowIfCancellationRequested ( ) ;
244
244
ThrowIfDisposed ( ) ;
@@ -255,21 +255,21 @@ protected virtual async Task SaveChanges(CancellationToken cancellationToken)
255
255
/// </summary>
256
256
/// <param name="id">The id to convert.</param>
257
257
/// <returns>An instance of <typeparamref name="TKey"/> representing the provided <paramref name="id"/>.</returns>
258
- public virtual TKey ConvertIdFromString ( string id )
258
+ public virtual TKey ? ConvertIdFromString ( string id )
259
259
{
260
260
if ( id == null )
261
261
{
262
262
return default ( TKey ) ;
263
263
}
264
- return ( TKey ) TypeDescriptor . GetConverter ( typeof ( TKey ) ) . ConvertFromInvariantString ( id ) ;
264
+ return ( TKey ? ) TypeDescriptor . GetConverter ( typeof ( TKey ) ) . ConvertFromInvariantString ( id ) ;
265
265
}
266
266
267
267
/// <summary>
268
268
/// Converts the provided <paramref name="id"/> to its string representation.
269
269
/// </summary>
270
270
/// <param name="id">The id to convert.</param>
271
271
/// <returns>An <see cref="string"/> representation of the provided <paramref name="id"/>.</returns>
272
- public virtual string ConvertIdToString ( TKey id )
272
+ public virtual string ? ConvertIdToString ( TKey id )
273
273
{
274
274
if ( id . Equals ( default ( TKey ) ) )
275
275
{
@@ -284,7 +284,7 @@ public virtual string ConvertIdToString(TKey id)
284
284
/// <param name="id">The role ID to look for.</param>
285
285
/// <param name="cancellationToken">The <see cref="CancellationToken"/> used to propagate notifications that the operation should be canceled.</param>
286
286
/// <returns>A <see cref="Task{TResult}"/> that result of the look up.</returns>
287
- public virtual Task < TRole > FindByIdAsync ( string id , CancellationToken cancellationToken = default ( CancellationToken ) )
287
+ public virtual Task < TRole ? > FindByIdAsync ( string id , CancellationToken cancellationToken = default ( CancellationToken ) )
288
288
{
289
289
cancellationToken . ThrowIfCancellationRequested ( ) ;
290
290
ThrowIfDisposed ( ) ;
@@ -298,7 +298,7 @@ public virtual string ConvertIdToString(TKey id)
298
298
/// <param name="normalizedName">The normalized role name to look for.</param>
299
299
/// <param name="cancellationToken">The <see cref="CancellationToken"/> used to propagate notifications that the operation should be canceled.</param>
300
300
/// <returns>A <see cref="Task{TResult}"/> that result of the look up.</returns>
301
- public virtual Task < TRole > FindByNameAsync ( string normalizedName , CancellationToken cancellationToken = default ( CancellationToken ) )
301
+ public virtual Task < TRole ? > FindByNameAsync ( string normalizedName , CancellationToken cancellationToken = default ( CancellationToken ) )
302
302
{
303
303
cancellationToken . ThrowIfCancellationRequested ( ) ;
304
304
ThrowIfDisposed ( ) ;
@@ -311,7 +311,7 @@ public virtual string ConvertIdToString(TKey id)
311
311
/// <param name="role">The role whose normalized name should be retrieved.</param>
312
312
/// <param name="cancellationToken">The <see cref="CancellationToken"/> used to propagate notifications that the operation should be canceled.</param>
313
313
/// <returns>A <see cref="Task{TResult}"/> that contains the name of the role.</returns>
314
- public virtual Task < string > GetNormalizedRoleNameAsync ( TRole role , CancellationToken cancellationToken = default ( CancellationToken ) )
314
+ public virtual Task < string ? > GetNormalizedRoleNameAsync ( TRole role , CancellationToken cancellationToken = default ( CancellationToken ) )
315
315
{
316
316
cancellationToken . ThrowIfCancellationRequested ( ) ;
317
317
ThrowIfDisposed ( ) ;
@@ -329,7 +329,7 @@ public virtual string ConvertIdToString(TKey id)
329
329
/// <param name="normalizedName">The normalized name to set</param>
330
330
/// <param name="cancellationToken">The <see cref="CancellationToken"/> used to propagate notifications that the operation should be canceled.</param>
331
331
/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns>
332
- public virtual Task SetNormalizedRoleNameAsync ( TRole role , string normalizedName , CancellationToken cancellationToken = default ( CancellationToken ) )
332
+ public virtual Task SetNormalizedRoleNameAsync ( TRole role , string ? normalizedName , CancellationToken cancellationToken = default ( CancellationToken ) )
333
333
{
334
334
cancellationToken . ThrowIfCancellationRequested ( ) ;
335
335
ThrowIfDisposed ( ) ;
@@ -371,7 +371,7 @@ protected void ThrowIfDisposed()
371
371
throw new ArgumentNullException ( nameof ( role ) ) ;
372
372
}
373
373
374
- return await RoleClaims . Where ( rc => rc . RoleId . Equals ( role . Id ) ) . Select ( c => new Claim ( c . ClaimType , c . ClaimValue ) ) . ToListAsync ( cancellationToken ) ;
374
+ return await RoleClaims . Where ( rc => rc . RoleId . Equals ( role . Id ) ) . Select ( c => new Claim ( c . ClaimType ! , c . ClaimValue ! ) ) . ToListAsync ( cancellationToken ) ;
375
375
}
376
376
377
377
/// <summary>
0 commit comments