Example #1
0
        public ActionResult Categories()
        {
            NorthwindDb            db         = new NorthwindDb(connectionString);
            IEnumerable <Category> categories = db.GetCategories();

            return(View(categories));
        }
Example #2
0
        public ActionResult Categories()
        {
            NorthwindDb             db = new NorthwindDb(_connectionString);
            CategoriesPageViewModel vm = new CategoriesPageViewModel
            {
                Categories = db.GetCategories()
            };

            return(View(vm));
        }
        public IActionResult Categories()
        {
            NorthwindDb db = new NorthwindDb(_connectionString);

            return(View(db.GetCategories()));
        }