示例#1
0
        public dynamic Put([FromBody] Car car)
        {
            var result = _carManager.CreateCar(car);

            return(new
            {
                success = result
            });
        }
示例#2
0
        public IActionResult CreateUpdateCar(CarViewModel car)
        {
            if (!ModelState.IsValid)
            {
                return(View("CreateUpdateCar", car));
            }

            if (car.Id == 0)
            {
                carManager.CreateCar(car);
            }
            else
            {
                carManager.UpdateCar(car);
            }

            return(Json(new { success = true }));
        }