Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
X.PagedList: PagedListExtensions: Fix logic in ToPagedList()
The command flow in ToPagedList with totalSetCount appears odd: * For totalCount <= 0, we should simply return an empty list * For supersetCount <= pageSize, we should not need additional conditions to simply read the list * From totalSetCount.HasValue, we know whether to use Count(), but not whether or not to use Skip/Take * Count() is always executed, even if we supply totalSetCount, which will create useless iterations and/or DB roundtrips if we already know the size. As a consequence, it appears more appropriate to use the logic from X.PagedList.EF here as well (only in the sync version), which addresses all the mentioned issues. Fixes: #266
- Loading branch information