public ActionResult <CarModel> PostCarModel(int carBrandId, [FromBody] CarModel carModel) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var createCarModel = carModelService.AddCarModel(carBrandId, carModel); return(Created($"api/carbrand/{carBrandId:int}/carModel/{createCarModel.id}", createCarModel)); }
public ActionResult Add(CarModelDto carModelDto) { var currentUser = Session["LogUser"] as UserDto; return(Json(_carModelService.AddCarModel(carModelDto, currentUser))); }