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