Пример #1
0
        private async Task LoadData()
        {
            ProductCategories = (await _productCategoryQuery.GetProductCategoryListOptionAsync())
                                .Select(o => new SelectListItem
            {
                Text     = o.Name,
                Value    = o.Id,
                Selected = o.Id == Command.CategoryId
            }).ToArray();

            Stores = (await _storeQuery.GetStoreListOptionAsync())
                     .Select(o => new SelectListItem
            {
                Text     = o.StoreName,
                Value    = o.Id,
                Selected = o.Id == Command.StoreId
            }).ToArray();

            Brands = (await _brandQuery.GetBrandListOptionAsync())
                     .Select(o => new SelectListItem
            {
                Text     = o.Name,
                Value    = o.Id,
                Selected = o.Id == Command.BrandId
            }).ToArray();
        }
Пример #2
0
        public async Task OnGet()
        {
            ProductCategories = (await _productCategoryQuery.GetProductCategoryListOptionAsync())
                                .Select(o => new SelectListItem
            {
                Text  = o.Name,
                Value = o.Id
            }).ToArray();

            Stores = (await _storeQuery.GetStoreListOptionAsync())
                     .Select(o => new SelectListItem
            {
                Text  = o.StoreName,
                Value = o.Id
            }).ToArray();

            Brands = (await _brandQuery.GetBrandListOptionAsync())
                     .Select(o => new SelectListItem
            {
                Text  = o.Name,
                Value = o.Id
            }).ToArray();
        }