Example #1
0
 public ActionResult <CarModel> DeleteCarModel(int carBrandId, int id)
 {
     try {
         var result = carModelService.RemoveCarModel(carBrandId, id);
         if (!result)
         {
             return(StatusCode(StatusCodes.Status500InternalServerError, "cannot delete Model"));
         }
         return(Ok(result));
     }
     catch (NotFoundItemException ex)
     {
         return(NotFound(ex.Message));
     }
     catch (Exception ex)
     {
         return(StatusCode(StatusCodes.Status500InternalServerError, ex.Message));
     }
 }