public virtual async Task UpdateClaimAsync(Guid id, IdentityRoleClaimUpdateDto input)
        {
            var role = await IdentityRoleRepository.GetAsync(id);

            var oldClaim = role.FindClaim(new Claim(input.ClaimType, input.ClaimValue));

            if (oldClaim != null)
            {
                role.RemoveClaim(oldClaim.ToClaim());
                role.AddClaim(GuidGenerator, new Claim(input.ClaimType, input.NewClaimValue));

                await IdentityRoleRepository.UpdateAsync(role);

                await CurrentUnitOfWork.SaveChangesAsync();
            }
        }
Beispiel #2
0
 public virtual async Task UpdateClaimAsync(Guid id, IdentityRoleClaimUpdateDto input)
 {
     await RoleAppService.UpdateClaimAsync(id, input);
 }