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)); } }
public async Task Post(Driver bookedCar) { await _repository.Create(bookedCar); }