public IActionResult UpdateUser(UpdateUserQuery query) { var user = _users.FirstOrDefault(e => e.Id == query.Id); if (user != null) { user.Login = query.Login; } return(Ok()); }
public async Task <IActionResult> UpdateUser(int id, User user) { if (!UserExist(id)) { return(Content($"User with id no. {id} not found")); } var query = new UpdateUserQuery(user); var result = await _mediator.Send(query); return(Content($"Successfuly updated user with id no. {user.Id}")); }