public async Task <SomeModelContract> UpdateAsync( SomeModelContract model) { _logger.LogTrace( $"Updating a SomeModel with Id {model.Id} based on the command data sent: " + $"{JsonConvert.SerializeObject(model)}"); var storedModel = _somemodelRepository.GetAsync(model.Id); if (storedModel == null) { _logger.LogWarning($"No such SomeModel model with Id {model.Id} found. Doing nothing."); return(model); } var result = await _somemodelRepository.UpdateAsync(CastToDomainModel(model)); return(CastToContract(result)); }