public string UpdateElem(int id, [FromBody] PilotsDTO element) { if (!ModelState.IsValid) { return("Not valid data"); } try { pilotService.Update(id, element); return("Updated new elemnt"); } catch (Exception e) { return(e.Message); } }
public string CreateNewElem([FromBody] PilotsDTO element) { if (!ModelState.IsValid) { return("Not valid data"); } try { pilotService.Create(element); return("Created the new element"); } catch (Exception e) { return(e.Message); } }
// PUT: api/Pilots/5 public ApiResult Put(int id, [FromBody] PilotsDTO value) { return(ServicesPilots.Update(value)); }
public ApiResult Post([FromBody] PilotsDTO value) { return(ServicesPilots.Insert(value)); }