示例#1
0
            public async Task <IResult> Handle(DeleteUserClaimCommand request, CancellationToken cancellationToken)
            {
                var entityToDelete = await _userClaimRepository.GetAsync(x => x.UserId == request.Id);

                _userClaimRepository.Delete(entityToDelete);
                await _userClaimRepository.SaveChangesAsync();

                return(new SuccessResult(Messages.Deleted));
            }
 public async Task <IDataResult <UserClaim> > Handle(GetUserClaimQuery request, CancellationToken cancellationToken)
 {
     return(new SuccessDataResult <UserClaim>(await _userClaimDal.GetAsync(x => x.Id == request.Id)));
 }
示例#3
0
 private async Task <bool> DoesClaimExistsForUser(UserClaim userClaim)
 {
     return((await _userClaimsRepository.GetAsync(x => x.UserId == userClaim.UserId && x.ClaimId == userClaim.ClaimId)) is { });