public ActionResult AddCar(Car car) { CarTwistDb db = new CarTwistDb(Properties.Settings.Default.ConStr); db.AddCar(car); return(Redirect("/")); }
public ActionResult Index() { CarTwistDb db = new CarTwistDb(Properties.Settings.Default.ConStr); IEnumerable <Car> cars = db.GetCars(); return(View(cars)); }
public ActionResult Index() { CarTwistDb db = new CarTwistDb(Properties.Settings.Default.ConStr); IEnumerable <Car> cars = db.GetCars(); HomePageViewModel viewModel = new HomePageViewModel(); viewModel.Cars = cars; return(View(viewModel)); }