Grid.Blazor icon indicating copy to clipboard operation
Grid.Blazor copied to clipboard

GridCoreServer taking an IQueryable

Open ArneMancofi opened this issue 3 years ago • 1 comments

Is your feature request related to a problem? Please describe. My backend storage provides me with an IQueryable<T>, but GridCoreServer<T> requires an IEnumerable<T>. Given a huge amount of items in storage, I do not want to enumerate them all at once.

Describe the solution you'd like A GridCoreServer<T> that takes an IQueryable<T>.

Describe alternatives you've considered Implementing my own private IGridServer<T>. However, this seems to be a feature generally useful for other projects as well.

ArneMancofi avatar Jun 17 '22 06:06 ArneMancofi

You can use IQueryable<T> as GridCoreServer<T`> parameter, because IQueryable<T> has inheritance of IEnumerable<T>.

If the number of records is high, I would use pagination:

    IGridServer<Order> server = new GridCoreServer<Order>(repository.GetAll(), Request.Query,
                true, "ordersGrid", ColumnCollections.OrderColumns)
                    .WithPaging(10);

gustavnavar avatar Jun 17 '22 14:06 gustavnavar