Ejemplo n.º 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
 };
Ejemplo n.º 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()));
 }
Ejemplo n.º 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)));
 }
Ejemplo n.º 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));
 }
Ejemplo n.º 5
0
 public Task <IdentityResult> CreateAsync(IIdentityRole <TKey> role, CancellationToken cancellationToken) => throw new NotImplementedException();
Ejemplo n.º 6
0
 public Task SetRoleNameAsync(IIdentityRole <TKey> role, string roleName, CancellationToken cancellationToken) => throw new NotImplementedException();
Ejemplo n.º 7
0
 public Task <string> GetRoleIdAsync(IIdentityRole <TKey> role, CancellationToken cancellationToken) => throw new NotImplementedException();