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