示例#1
0
        public IActionResult Index()
        {
            ChefsView viewModel = new ChefsView();

            viewModel.Chefs = dbContext.Chefs
                              .Include(d => d.CreatedDishes)
                              .ToList();
            return(View("Index", viewModel));
        }
示例#2
0
        public IActionResult DisplayChefs()
        {
            ChefsView viewModel = new ChefsView();

            viewModel.Chefs = dbContext.Chefs
                              .Include(d => d.Dishes)
                              .ToList();

            return(View("ChefDisplay", viewModel));
        }