public string UpdateElem(int id, [FromBody] CrewsDTO element) { if (!ModelState.IsValid) { return("Not valid data"); } try { crewService.Update(id, element); return("Updated new elemnt"); } catch (Exception e) { return(e.Message); } }
public string CreateNewElem([FromBody] CrewsDTO element) { if (!ModelState.IsValid) { return("Not valid data"); } try { crewService.Create(element); return("Created the new element"); } catch (Exception e) { return(e.Message); } }