Replies: 1 comment
-
hi @hfirst, public interface ICustomGridifyQuery : IGridifyFiltering, IGridifyOrdering
{
public int Skip { get; set; }
public int Take { get; set; }
}
public class CustomGridifyQuery : ICustomGridifyQuery
{
public string Filter { get; set; }
public string OrderBy { get; set; }
public int Skip {get; set;}
public int Take {get; set;}
}
public static class MyExtensions
{
public static Paging<T> Gridify<T>(this IQueryable<T> query, ICustomGridifyQuery? customGridifyQuery, IGridifyMapper<T>? mapper = null)
{
query = query.ApplyFiltering(customGridifyQuery, mapper);
int count = query.Count();
query = query.ApplyOrdering(customGridifyQuery, mapper);
query = query.Skip(customGridifyQuery.Skip).Take(customGridifyQuery.Take);
return new Paging<T>(count, query.ToList());
}
} then all you need to do is to use your CustomGridifyQuery class instead |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The current paging the way it uses page and pagesize is very limiting. The grids I use with infinite virtual scrolling don't have the concept of a 'page'. Just startindex and buffersize. Could you please add a way to directly set these? IMO it's more flexible and also still allows for paging instead of having the math for paging buried inside Gridify. There's a reason LINQ has skip and take and not page and pagesize.
Beta Was this translation helpful? Give feedback.
All reactions