Commit 7dbc4c69 authored by thienvo's avatar thienvo

optimize sieve

parent e1412b76
......@@ -421,10 +421,16 @@ namespace Sieve.Services
take = Math.Min(pageSize, maxPageSize);
}
public bool enablePagination = true;
private IQueryable<TEntity> ApplyPagination<TEntity>(
TSieveModel model,
IQueryable<TEntity> result)
{
if (!enablePagination)
{
return result;
}
var page = model?.Page ?? 1;
var pageSize = model?.PageSize ?? _options.Value.DefaultPageSize;
var maxPageSize = _options.Value.MaxPageSize > 0 ? _options.Value.MaxPageSize : pageSize;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment