public IActionResult About(int id) { SupplierBuilder supplier = new SupplierBuilder(); FranchiseBuilder company = new FranchiseBuilder(); List <Franchise> allStores = company.SellFranchise(); ProductOrderingViewModel viewModel = new ProductOrderingViewModel(); viewModel.Store = allStores.SingleOrDefault(store => store.Id == id); viewModel.Suppliers = supplier.GetSuppliers(); return(View(viewModel)); }
public IActionResult Index() { FranchiseBuilder company = new FranchiseBuilder(); SupplierBuilder allSuppliers = new SupplierBuilder(); List <Franchise> allStores = company.SellFranchise(); StoreListViewModel viewModel = new StoreListViewModel(); viewModel.Stores = allStores; viewModel.Suppliers = allSuppliers.GetSuppliers(); return(View(viewModel)); }