Exemple #1
0
        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));
        }
Exemple #2
0
        public ActionResult Add(CarModelDto carModelDto)
        {
            var currentUser = Session["LogUser"] as UserDto;

            return(Json(_carModelService.AddCarModel(carModelDto, currentUser)));
        }