Ejemplo n.º 1
0
 public IHttpActionResult Post([FromBody] ship t)
 {
     try
     {
         return(Ok(context.InsertAndGetItem(t)));
     }
     catch (Exception ex)
     {
         return(Content(HttpStatusCode.NotAcceptable, ex.Message));
     }
 }
Ejemplo n.º 2
0
 public IActionResult Post([FromBody] Ships t)
 {
     try
     {
         return(Ok(context.InsertAndGetItem(t)));
     }
     catch (Exception ex)
     {
         return(BadRequest(new ErrorMessage(ex.Message)));
     }
 }