paged filtering - Envivo-Software/Envivo.Fresnel GitHub Wiki

Paged Filtering

Your Repository may connect to a database provider that isn't fully Linq compatible. In these cases, you can implement the IPagedFiltering<T> interface on your repository class.

Fresnel will use the GetResultsPageAsync method, where you can apply the appropriate operations based on the IQueryFilter argument.

public class ProductRepository : IRepository<Product>, IPagedFiltering<Product> //👈
{
    ...

    /// <summary>
    /// <inheritdoc/>
    /// </summary>
    /// <returns></returns>
    public Task<(IEnumerable<Product>, int)> GetResultsPageAsync(IQueryFilter queryFilter) //👈
    {
        // Use the provided the queryFilter properties to 
        // fetch the appropriate matches against your database:
        var result = <your custom logic here>;
        return Task.FromResult(result); 
    }

    ...
}
⚠️ **GitHub.com Fallback** ⚠️