You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
896 B

using BlazorApp1.Components;
using BlazorApp1.Models;
using BlazorApp1.Sevices;
using Blazorise.DataGrid;
using Microsoft.AspNetCore.Components;
namespace BlazorApp1.Pages
{
public partial class PageInventory
{
[Parameter]
public List<Item> Items { get; set; }
[Parameter]
public int totalItems { get; set; }
[Inject]
public IDataService DataService { get; set; }
private async Task OnReadData(DataGridReadDataEventArgs<Item> e)
{
if (e.CancellationToken.IsCancellationRequested)
{
return;
}
if (!e.CancellationToken.IsCancellationRequested)
{
Items = await DataService.List(e.Page, e.PageSize);
totalItems = await DataService.Count();
}
}
}
}