Example #1
0
 public IActionResult EditCar(Car car)
 {
     if (ModelState.IsValid)
     {
         allCars.CreateCar(car);
         return(RedirectToAction("Index"));
     }
     return(View(car));
 }
Example #2
0
        public async Task <IActionResult> Create(CreateCarViewModel form)
        {
            var newCar = _allCars.CreateCar(form);
            await _hubContext.Clients.All.SendAsync("needUpdateCars", newCar);

            _logger.LogInformation($"LOG Creatind new car Model; Sending hubs");

            // await Task.Delay(1000);

            return(Redirect("/Home/Index"));
        }