public async void ConfirmDialog_OnDialogClose() { await StoreDataService.DeleteStore(this.SelectedStore.Id); Stores = (await StoreDataService.GetAllStores()).ToList(); ToastService.ShowToast($"Store ''{this.SelectedStore.Name}'' has been deleted!", ToastLevel.Warning); //DisplayStatusAlert("alert-danger", $"Store ''{this.SelectedStore.Name}'' has been deleted!"); await FilterStores(); await ScrollToTop(); }
private async Task FilterStores() { allStores = (await StoreDataService.GetAllStores()).ToList(); int.TryParse(this.CategoryId, out var categoryId); if (categoryId == 0) { this.Stores = allStores; } else { if (allStores != null) { this.Stores = allStores.Where(store => store.CategoryId == categoryId.ToString()).ToList(); } } this.SelectedStore = null; StateHasChanged(); }