Exemple #1
0
 public static TUserRole xCreateUserRole <TKey, TUserRole>(this IIdentityUserWithRoles <TKey> user, IIdentityRole <TKey> role)
     where TKey : IEquatable <TKey>
     where TUserRole : class, IIdentityUserRole <TKey>, new()
 => new TUserRole()
 {
     UserId = user.Id,
     RoleId = role.Id
 };
Exemple #2
0
 public static async Task <string> xGetRoleIdAsync <TKey>(this IIdentityRole <TKey> role, CancellationToken cancellationToken = default) where TKey : IEquatable <TKey>
 {
     cancellationToken.ThrowIfCancellationRequestedOrRoleNull(role);
     return(await Task.FromResult(role.Id.ConvertIdToString()));
 }
Exemple #3
0
 public static async Task xSetRoleNameAsync <TKey>(this IIdentityRole <TKey> role, string roleName, CancellationToken cancellationToken = default) where TKey : IEquatable <TKey>
 {
     cancellationToken.ThrowIfCancellationRequestedOrRoleNull(role);
     await Task.FromResult(role.Name = roleName ?? throw new ArgumentNullException(nameof(roleName)));
 }
Exemple #4
0
 public static async Task <string> xGetNormalizedRoleNameAsync <TKey>(this IIdentityRole <TKey> role, CancellationToken cancellationToken = default) where TKey : IEquatable <TKey>
 {
     cancellationToken.ThrowIfCancellationRequestedOrRoleNull(role);
     return(await Task.FromResult(role.NormalizedName));
 }
Exemple #5
0
 public Task <IdentityResult> CreateAsync(IIdentityRole <TKey> role, CancellationToken cancellationToken) => throw new NotImplementedException();
Exemple #6
0
 public Task SetRoleNameAsync(IIdentityRole <TKey> role, string roleName, CancellationToken cancellationToken) => throw new NotImplementedException();
Exemple #7
0
 public Task <string> GetRoleIdAsync(IIdentityRole <TKey> role, CancellationToken cancellationToken) => throw new NotImplementedException();