public Task AddClaimAsync(TUser user, Claim claim) { if (user == null) { throw new ArgumentNullException("user"); } if (claim == null) { throw new ArgumentNullException("claim"); } CustomUserClaim <string> c = new CustomUserClaim <string>(claim.Type, claim.Value); c.UserId = user.Id; c.Id = 0; //store has to figure out this one itself user.Claims.Add(c); return(Task.FromResult(0)); }
public Task RemoveClaimAsync(TUser user, Claim claim) { if (user == null) { throw new ArgumentNullException("user"); } if (claim == null) { throw new ArgumentNullException("claim"); } CustomUserClaim <string> c = user.Claims.FirstOrDefault(x => x.ClaimType == claim.Type && x.ClaimValue == claim.Value); if (c != null) { user.Claims.Remove(c); } return(Task.FromResult(0)); }