public HomeModule()
 {
     Get["/"] = _ => {
     // Car firstCar = new Car("Acura", 10000, 10000);
     // Car secondCar = new Car("Bmw", 20000, 50000);
     // Car thirdCar = new Car("Benz", 30000, 5000);
     // "hello world";
     return View["dealership.cshtml"];
       };
       Get["/page2"] = _ => {
     Car firstCar = new Car("Acura", 10000, 10000);
     return View["page2.cshtml", firstCar];
       };
 }
Exemple #2
0
        public HomeModule()
        {
            Get["/"] = _ => View["new_car_form.cshtml"];

              Post["/Car_entry"] = _ => {
            Car newCar = new Car(Request.Form["Model"], Request.Form["Price"],Request.Form["Miles"]);
            newCar.Save();
            return View["new_car_confirmation.cshtml", newCar];
              };

              Get["/stock"] = _ => {
            var allCars = Car.GetAll();
            return View["show_inventory.cshtml", allCars];
              };
        }