Exemple #1
0
        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));
        }
Exemple #2
0
        //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));
        }
Exemple #4
0
 internal SelectList GetMakes(IMakeRepo makeRepo)
 => new SelectList(makeRepo.GetAll(), nameof(Make.Id), nameof(Make.Name));
 public IActionResult Index()
 {
     return(View(_repo.GetAll()));
 }
Exemple #6
0
 public void OnGet()
 {
     Makes = _repo.GetAll().ToList();
 }