Ejemplo n.º 1
0
        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());
        }
Ejemplo n.º 2
0
 public static void PopulateWith(this User source, AdminUserPatchReqeust with)
 {
     // Normally would use a mapper here, but for now...
     source.Status = with.Status;
 }