public async Task <IActionResult> EditUser(Guid id, [FromBody] UserDto user) { if (user == null) { _logger.LogError("User object sent from client is null."); return(BadRequest("User object is null")); } if (id != user.Id) { return(BadRequest()); } var existingItem = await _userQuery.GetAsync(id); if (existingItem == null) { _logger.LogError($"User with id: {id}, hasn't been found in db."); return(NotFound()); } await _userCommand.UpdateAsync(user); return(NoContent()); // 204 }
public async Task UpdateAsync(User user) { await _userCommand.UpdateAsync(user); }