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(); }
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(); }