public ActionResult Patch(int id, [FromBody] AdminUserPatchReqeust value) { var existingUser = _userRepository.GetById(id); if (existingUser == null) { return(NotFound()); } existingUser.PopulateWith(value); _userRepository.Update(existingUser); return(NoContent()); }
public static void PopulateWith(this User source, AdminUserPatchReqeust with) { // Normally would use a mapper here, but for now... source.Status = with.Status; }