コード例 #1
0
        public IActionResult EditCar(Car car)
        {
            Car kek = Car_Repo.GetAll().FirstOrDefault(x => x.Id == car.Id);

            if (kek == null)
            {
                ViewBag.ErrorMesage = $"Car with id {car.Id} cannot be found";
                return(View("NotFound"));
            }
            else
            {
                Car_Repo.Edit(car);
            }
            return(View("/Views/Home/Index.cshtml"));
        }