public ActionResult AddVehicle() { VehicleAdminVM adminVM = new VehicleAdminVM(); adminVM.SetAllListItems(); adminVM.Makes = new SelectList(makeRepo.GetAll(), "MakeId", "MakeName"); adminVM.Models = new SelectList(modelRepo.GetAll(), "ModelId", "ModelName"); adminVM.Vehicle = new Vehicle(); adminVM.FileType = "."; return(View(adminVM)); }
//public async Task<IViewComponentResult> InvokeAsync() public IViewComponentResult Invoke() { var makes = _makeRepo.GetAll(); if (makes == null) { return(new ContentViewComponentResult("Unable to get the makes")); } return(View("MenuView", makes)); }
//public async Task<IViewComponentResult> InvokeAsync() public IViewComponentResult Invoke() { var makes = _repo.GetAll(); if (makes == null) { return(new ContentViewComponentResult("There was an error getting the makes")); } return(View("MenuView", makes)); }
internal SelectList GetMakes(IMakeRepo makeRepo) => new SelectList(makeRepo.GetAll(), nameof(Make.Id), nameof(Make.Name));
public IActionResult Index() { return(View(_repo.GetAll())); }
public void OnGet() { Makes = _repo.GetAll().ToList(); }