public async Task <IdentityResourceDto> UpdateAsync(Guid id, UpdateIdentityResourceInputDto input) { var nameExist = await _repository.CheckNameExistAsync(input.Name, id); if (nameExist) { throw new IdentityResourceNameNotAllowedDuplicateException(input.Name); } var identityResource = await _repository.FindAsync(id); identityResource = ObjectMapper.Map <UpdateIdentityResourceInputDto, IdentityResource>(input, identityResource); // userClaim identityResource.RemoveAllUserClaims(); if (input.UserClaims != null) { input.UserClaims.ForEach(e => { identityResource.AddUserClaim(e); }); } identityResource = await _repository.UpdateAsync(identityResource); return(MapToGetOutputDto(identityResource)); }
public async Task <IdentityResourceDto> UpdateAsync(Guid id, UpdateIdentityResourceInputDto input) { var nameExist = await _repository.CheckNameExistAsync(input.Name, id); if (nameExist) { throw new IdentityResourceNameNotAllowedDuplicateException(input.Name); } var identityResource = await _repository.FindAsync(id); identityResource = ObjectMapper.Map <UpdateIdentityResourceInputDto, IdentityResource>(input, identityResource); identityResource = await _repository.UpdateAsync(identityResource); return(MapToGetOutputDto(identityResource)); }
public async Task <IdentityResourceDto> UpdateAsync(Guid id, UpdateIdentityResourceInputDto input) { return(await this._identityResourceAppService.UpdateAsync(id, input)); }