示例#1
0
        // GET: Paid
        public ActionResult Index()
        {
            var model = new vwProdCat()
            {
                Categories = db.Categories.OrderBy(cat => cat.Id).Take(4).ToList(),
                Products   = db.Products.Where(prod => prod.CategoryId < 5).OrderBy(prod => prod.OrderBy).ToList()
            };

            return(View(model));
        }
        // GET: Restorant
        public ActionResult Restoran()
        {
            var model = new vwProdCat()
            {
                Categories = db.Categories.OrderByDescending(cat => cat.Id).Take(5).ToList(),
                Products   = db.Products.OrderBy(prod => prod.OrderBy).ToList()
            };

            return(View(model));
        }