Example #1
0
 //
 // GET: /Restaurant/Details/5
 public ActionResult Details(int id)
 {
     using (TweakContext tweakcontext = new TweakContext())
     {
         var Restaurant = from restaurant in tweakcontext.Restaurants
                          where restaurant.ID == id
                          select restaurant;
         Restaurant res = Restaurant.ToList<Restaurant>()[0];
         IList<Dish> dishes = res.Dishes.ToList<Dish>();
         return View(new RestaurantViewModel(res,dishes));
     }
 }
Example #2
0
 //
 // GET: /Restaurant/
 public ActionResult Index()
 {
     using (TweakContext tweakcontext = new TweakContext())
     {
         var Restaurants = from restaurant in tweakcontext.Restaurants
                           select restaurant;
         return View(Restaurants.ToList<Restaurant>());
     }
 }