Exemple #1
0
 public virtual async Task RemoveClaimAsync(TUser user, Claim claim)
 {
     user.CheckNotNull("user");
     claim.CheckNotNull("claim");
     string type  = claim.Type;
     string value = claim.Value;
     await UserClaimRepository.DeleteAsync(m => m.User.Id.Equals(user.Id) && m.ClaimType == type && m.ClaimValue == value);
 }
Exemple #2
0
 public virtual async Task AddClaimAsync(TUser user, Claim claim)
 {
     user.CheckNotNull("user");
     claim.CheckNotNull("claim");
     TUserClaim userClaim = new TUserClaim()
     {
         ClaimType = claim.Type, ClaimValue = claim.Value, User = user
     };
     await UserClaimRepository.InsertAsync(userClaim);
 }