public MyProduct() { this.Basket = new HashSet <Basket>(); this.Sales = new HashSet <Sales>(); this.BrandList = new List <SelectListItem>(); BrandList.Insert(0, new SelectListItem { Text = "Önce kategori seçilmelidir.", Value = "" }); }
public async Task Init() { IsBusy = true; if (BrandList.Count == 0) { var brandList = await _serviceBrands.Get <IEnumerable <Brand> >(null); foreach (var brand in brandList) { BrandList.Add(brand); } BrandList.Insert(0, new Brand() { Name = null }); } if (SelectedBrand != null) { var request = new Model.Requests.Vehicle.VehicleSearchRequest() { BrandId = SelectedBrand.Id }; var list = await _serviceVehicles.Get <IEnumerable <Vehicle> >(request); VehicleList.Clear(); foreach (var vehicle in list) { VehicleList.Add(vehicle); } } else { var list = await _serviceVehicles.Get <IEnumerable <Vehicle> >(null); VehicleList.Clear(); foreach (var vehicle in list) { VehicleList.Add(vehicle); } } IsBusy = false; }