コード例 #1
0
 public static async Task <IList <Claim> > GetClaimsAsync(this IUsersClaimsRepository usersClaims,
                                                          Guid userId, CancellationToken cancellationToken = default)
 {
     cancellationToken.ThrowIfCancellationRequested();
     return((await usersClaims.ProcessQueryAsync(
                 usersClaims.AsQueryable()
                 .Where(x => x.UserId == userId),
                 cancellationToken)).Select(x => x.ToClaim()).ToList());
 }
コード例 #2
0
 public static async Task <IReadOnlyCollection <UserClaim> > FindMatchedClaimsAsync(
     this IUsersClaimsRepository usersClaims,
     Guid userId, string value, string type, CancellationToken cancellationToken = default)
 {
     cancellationToken.ThrowIfCancellationRequested();
     return(await usersClaims.ProcessQueryAsync(
                usersClaims.AsQueryable()
                .Where(x => x.UserId == userId && x.ClaimValue == value && x.ClaimType == type),
                cancellationToken));
 }