Commit 9d315d87 authored by thienvo's avatar thienvo

fixed total sieve for search

parent 457f108c
...@@ -329,7 +329,7 @@ namespace Sieve.Services ...@@ -329,7 +329,7 @@ namespace Sieve.Services
return result; return result;
} }
public int ResultCountBeForeApplyPagination = 0;
private IQueryable<TEntity> ApplyPagination<TEntity>( private IQueryable<TEntity> ApplyPagination<TEntity>(
TSieveModel model, TSieveModel model,
IQueryable<TEntity> result) IQueryable<TEntity> result)
...@@ -337,7 +337,7 @@ namespace Sieve.Services ...@@ -337,7 +337,7 @@ namespace Sieve.Services
var page = model?.Page ?? 1; var page = model?.Page ?? 1;
var pageSize = model?.PageSize ?? _options.Value.DefaultPageSize; var pageSize = model?.PageSize ?? _options.Value.DefaultPageSize;
var maxPageSize = _options.Value.MaxPageSize > 0 ? _options.Value.MaxPageSize : pageSize; var maxPageSize = _options.Value.MaxPageSize > 0 ? _options.Value.MaxPageSize : pageSize;
ResultCountBeForeApplyPagination = result.Count();
if (pageSize > 0) if (pageSize > 0)
{ {
result = result.Skip((page - 1) * pageSize); result = result.Skip((page - 1) * 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