public ActionResult <MyEntity> Update([FromBody] MyEntityDTO entityDto) { var myEntity = entityDto.ToMyEntity(); _service.Update(myEntity); return(Ok(_service.Get(myEntity.Id))); }
public ActionResult <MyEntity> Add([FromBody] MyEntityDTO entityDto) { var myEntity = entityDto.ToMyEntity(); _service.Add(myEntity); return(CreatedAtAction(nameof(Get), new { id = myEntity.Id }, myEntity)); }