public ActionResult <ServiceLeaderDto> UpdateServiceLeader(int id, [FromBody] ServiceLeaderDto dto) { try { return(Ok(_serviceLeaderService.Update(id, dto))); } catch (KeyNotFoundException e) { return(NotFound($"{e.Message} ID: {id}")); } }
public ActionResult <ServiceLeaderDto> CreateServiceLeader([FromBody] ServiceLeaderDto dto) { ServiceLeaderDto createdDto; try { createdDto = _serviceLeaderService.Create(dto); } catch (KeyNotFoundException e) { return(NotFound(e.Message)); } return(Ok(createdDto)); }