public virtual async Task AddClaimAsync(Guid id, IdentityUserClaimCreateDto input) { var user = await UserManager.GetByIdAsync(id); var claim = new Claim(input.ClaimType, input.ClaimValue); if (user.FindClaim(claim) != null) { throw new UserFriendlyException(L["UserClaimAlreadyExists"]); } user.AddClaim(GuidGenerator, claim); (await UserManager.UpdateAsync(user)).CheckErrors(); await CurrentUnitOfWork.SaveChangesAsync(); }
public virtual async Task AddClaimAsync(Guid id, IdentityUserClaimCreateDto input) { await UserAppService.AddClaimAsync(id, input); }