private async Task DisplayData() { var articleSet = await CategoryRepositoryAsync.GetAllAsync(pager.PageIndex, pager.PageSize); pager.RecordCount = articleSet.TotalRecords; customers = articleSet.Records.ToList(); }
protected override async Task OnInitializedAsync() { Product = await ProductRepositoryAsync.GetByIdAsync(ProductId); Categories = await CategoryRepositoryAsync.GetAllAsync(); CategoryId = Product.CategoryId.ToString(); }
protected async void btnDelete_Click() { await CategoryRepositoryAsync.DeleteAsync(Category.CategoryId); CategoryDeleteDialog.Close(); Category = new Category(); await DisplayData(); StateHasChanged(); }
protected async void btnSaveOrUpdate_Click() { if (Model.CategoryId == 0) { await CategoryRepositoryAsync.AddAsync(Model); SaveOrUpdated?.Invoke(); } else { await CategoryRepositoryAsync.EditAsync(Model); await ChangeCallback.InvokeAsync(true); } IsShow = false; }
protected override async Task OnInitializedAsync() { Categories = await CategoryRepositoryAsync.GetAllAsync(); }