Esempio n. 1
0
        public ActionResult Create([Bind(Include = "ID,Brand,Model,Year")] Driver driver)
        {
            if (ModelState.IsValid)
            {
                _driverRepository.Create(driver);
                return(RedirectToAction("Index"));
            }

            return(View(driver));
        }
 public ActionResult Create(Driver model)
 {
     if (ModelState.IsValid)
     {
         try
         {
             _rep.Create(model);
             return(RedirectToAction("Index"));
         }
         catch (Exception)
         {
             throw;
         }
     }
     else
     {
         return(View(model));
     }
 }
Esempio n. 3
0
 public async Task Post(Driver bookedCar)
 {
     await _repository.Create(bookedCar);
 }