public ActionResult <CarsType> CreateCarType([FromBody] CarsType value) { try { if (value != null) { WebDb.AddCarsType(value); WebDb.SaveChanges(); return(Ok(value)); } } catch (Exception ex) { return(NotFound("Couldn't post car - error: " + ex.Message)); } return(NotFound()); }