public async Task <ConfigGenericItemExtentionDto> UpdateConfigGenericItemExtentionAsync(UpdateConfigGenericItemExtentionRequestDto request, string userName) { _logger.LogDebug($"Update config generic item extention with request : {JsonConvert.SerializeObject(request)}"); await _updateValidator.ValidateAndThrowAsync(request); var entity = await _dbContext.ConfigGenericItemExtensions.SingleOrDefaultAsync(x => x.GroupId == request.GroupId && x.ItemId == request.ItemId && x.Id == request.Id); if (entity != null) { _mapper.Map(request, entity); entity.LastUpdatedDate = DateTime.Now; entity.LastUpdatedUserName = userName; _dbContext.ConfigGenericItemExtensions.Update(entity); await _dbContext.SaveChangesAsync(); return(_mapper.Map <ConfigGenericItemExtentionDto>(entity)); } _logger.LogError($"Cannot find config generic item extention to update with request {JsonConvert.SerializeObject(request)}"); return(null); }
public async Task <ConfigGenericItemExtentionDto> UpdateConfigGenericItemExtentionDtoAsync([FromBody] UpdateConfigGenericItemExtentionRequestDto request) { return(await _configGenericItemExtentionService.UpdateConfigGenericItemExtentionAsync(request, Account?.FullName)); }