Exemple #1
0
        public IActionResult Create(AutoEditModel autoEditModel)
        {
            if (ModelState.IsValid)
            {
                var auto = new Auto();
                auto.Name  = autoEditModel.Name;
                auto.Power = autoEditModel.Power;
                auto.brand = autoEditModel.Brand;
                auto       = _auto.Add(auto);
                return(View("Detail", auto));

                //return RedirectToAction(nameof(Detail), new { id = auto.Id });
            }
            else
            {
                return(View());
            }
        }