public ApplicationController() { var selectedGarage = MainRepository.selectedGarage; var selectedOwner = MainRepository.selectedOwner; if (selectedGarage != null) { ViewBag.selectedGarage = selectedGarage.Name; } else { ViewBag.selectedGarage = "Inget valt garage"; } if (selectedOwner != null) { ViewBag.selectedOwner = selectedOwner.FullName; } else { ViewBag.selectedOwner = "Inget valt garage"; } //ViewBag.GarageCount = _garage.GetAllGarages().Count(); ViewBag.Garages = _garage.GetAllGarages(); ViewBag.Owners = _owner.GetAllOwners(); }
// GET: Garages public ActionResult Index() { return(View(_garage.GetAllGarages())); }