public IActionResult Put(long id, [FromBody] UserViewModel user) { if (_userAppService.GetById(user.Id).Id != 0) { user = _userAppService.Update(user); user.AddRangeLink(_userEnricher.CreateLinks(Method.Put, user)); return(Ok(user)); } else { return(BadRequest()); } }
public UserViewModel Post([FromBody] UserViewModel user) { user = _userAppService.Add(user); user.AddRangeLink(_userEnricher.CreateLinks(Method.Post, user)); return(user); }