Exemple #1
0
        public virtual async Task <ApiResourceDto> UpdateAsync(Guid id, ApiResourceUpdateDto input)
        {
            var apiResource = await ApiResourceRepository.GetAsync(id);

            await UpdateApiResourceByInputAsync(apiResource, input);

            apiResource = await ApiResourceRepository.UpdateAsync(apiResource);

            await CurrentUnitOfWork.SaveChangesAsync();

            return(ObjectMapper.Map <ApiResource, ApiResourceDto>(apiResource));
        }
        public virtual async Task <ApiResourceDto> UpdateAsync(Guid id, ApiResourceUpdateDto input)
        {
            var apiResource = await ApiResourceRepository.GetAsync(id);

            apiResource.DisplayName = input.DisplayName ?? apiResource.DisplayName;
            apiResource.Description = input.Description ?? apiResource.Description;
            apiResource.Enabled     = input.Enabled;

            await UpdateApiResourceByInputAsync(apiResource, input);

            apiResource = await ApiResourceRepository.UpdateAsync(apiResource);

            await CurrentUnitOfWork.SaveChangesAsync();

            return(ObjectMapper.Map <ApiResource, ApiResourceDto>(apiResource));
        }
        public virtual async Task <ApiResourceDto> UpdateAsync(ApiResourceUpdateDto apiResourceUpdate)
        {
            var apiResource = await ApiResourceRepository.GetAsync(apiResourceUpdate.Id);

            apiResource.DisplayName = apiResourceUpdate.DisplayName ?? apiResource.DisplayName;
            apiResource.Description = apiResourceUpdate.Description ?? apiResource.Description;
            apiResource.Enabled     = apiResourceUpdate.Enabled;

            apiResource.RemoveAllUserClaims();
            foreach (var userClaim in apiResourceUpdate.UserClaims)
            {
                apiResource.AddUserClaim(userClaim.Type);
            }
            apiResource = await ApiResourceRepository.UpdateAsync(apiResource);

            return(ObjectMapper.Map <ApiResource, ApiResourceDto>(apiResource));
        }
 public virtual async Task <ApiResourceDto> UpdateAsync(Guid id, ApiResourceUpdateDto input)
 {
     return(await ApiResourceAppService.UpdateAsync(id, input));
 }
Exemple #5
0
 public virtual async Task <ApiResourceDto> UpdateAsync(ApiResourceUpdateDto apiResourceUpdate)
 {
     return(await ApiResourceAppService.UpdateAsync(apiResourceUpdate));
 }