public ActionResult <MyEntityView> Put(long id, MyEntityView view) { if (id <= 0) { return(BadRequest()); } var model = _mapper.Map <MyEntity>(view); var updated = _myEntityService.Update(id, x => { _mapper.Map(view, x); }); var res = _mapper.Map <MyEntityView>(updated); return(res); }
public IActionResult Update([FromBody] MyEntityDto updateUserRequest) { var updatedEntity = myEntityService.Update(updateUserRequest); return(Ok(updatedEntity)); }