dotnet models and IQueryable extensions for handling server-side paging, sorting, filtering, and saving grid state for data-grid-vue
Note
DataGridVueDotnet currently targets .NET 6 and probably will until support ends in November 2024.
dotnet add package DataGridVueDotnet
[HttpPost]
public async Task<ActionResult<PageData<TestDataItem>>> Post(PageDataRequest request)
{
if (request is null || !request.IsValid)
{
return BadRequest();
}
var query = _context.TestDataItems.AsQueryable();
var dataItems = await query
.ApplyPageDataRequest(request)
.ToArrayAsync();
var count = await query
.Filter(request)
.CountAsync();
return Ok(new PageData<TestDataItem>()
{
DataItems = dataItems,
TotalItems = count
});
}
A full example with an ASP.NET API and EF Core context can be seen in the DataGridVueDotnetExample folder.
- Add grid identifier to storage request models
- Include symbols
- Add models for server-side storage
- Add documentation comments
- Update readme
- initial release