Пример #1
0
        public ActionResult List()
        {
            var items = _repository.Getproducts();

            var model = new ProductGridModel //2
            {
                Items = items,
                Count = items.Count()
            };

            //return View(items);
            return(View(model));
        }
Пример #2
0
        public ActionResult List()
        {
            // tests connection
            //using (var db = new SportShopContext())
            //{
            //    var customer = new Customer
            //    {
            //        Email = "test@test"
            //    };
            //    db.Customers.Add(customer);
            //    db.SaveChanges();
            //}

            var items = _repository.Getproducts();

            var model = new ProductGridModel //2
            {
                Items = items,
                Count = items.Count()
            };

            //return View(items);
            return(View(model));
        }