示例#1
0
        public async Task <IActionResult> Add()
        {
            List <Manufacturer> manufacturers = await _manufacturers.GetManufacturersAsync();

            AddModelViewModel model = new AddModelViewModel();

            model.SetManufacturers(manufacturers);
            return(View(model));
        }
示例#2
0
        public async Task <IActionResult> Index(int manufacturerId = 0)
        {
            // Construct the model and assign the selected manufacturer
            ListModelsViewModel model = new ListModelsViewModel();

            model.ManufacturerId = manufacturerId;

            // Load the manufacturer list
            List <Manufacturer> manufacturers = await _manufacturers.GetManufacturersAsync();

            model.SetManufacturers(manufacturers);

            return(View(model));
        }
示例#3
0
 /// <summary>
 /// Return the available manufacturers
 /// </summary>
 /// <returns></returns>
 public async Task <List <Manufacturer> > GetManufacturersAsync()
 => await _manufacturers.GetManufacturersAsync();
示例#4
0
        public async Task <IActionResult> Index()
        {
            List <Manufacturer> manufacturers = await _client.GetManufacturersAsync();

            return(View(manufacturers));
        }