mirror of
https://github.com/Biarity/Sieve.git
synced 2024-11-21 21:12:50 +01:00
Only Skip when pageSize > 0
This commit is contained in:
parent
9f6163d318
commit
567cd67c7f
@ -337,10 +337,9 @@ namespace Sieve.Services
|
|||||||
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;
|
||||||
|
|
||||||
result = result.Skip((page - 1) * pageSize);
|
|
||||||
|
|
||||||
if (pageSize > 0)
|
if (pageSize > 0)
|
||||||
{
|
{
|
||||||
|
result = result.Skip((page - 1) * pageSize);
|
||||||
result = result.Take(Math.Min(pageSize, maxPageSize));
|
result = result.Take(Math.Min(pageSize, maxPageSize));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user