Commit 8df59de9 authored by thienvo's avatar thienvo

fixed

parent 7ba61ec3
...@@ -477,9 +477,10 @@ namespace Sieve.Services ...@@ -477,9 +477,10 @@ namespace Sieve.Services
} }
outerExpression = Expression.And(outerExpression, innerExpression); outerExpression = Expression.And(outerExpression, innerExpression);
} }
return outerExpression == null var data = outerExpression == null
? result ? result
: result.Where(Expression.Lambda<Func<TEntity, bool>>(outerExpression, parameterExpression)); : result.Where(Expression.Lambda<Func<TEntity, bool>>(outerExpression, parameterExpression));
return data;
} }
private static string GetDynamicQueryString(TFilterTerm filterTerm, string property, string value) private static string GetDynamicQueryString(TFilterTerm filterTerm, string property, string value)
{ {
...@@ -601,7 +602,15 @@ namespace Sieve.Services ...@@ -601,7 +602,15 @@ namespace Sieve.Services
var maxPageSize = _options.Value.MaxPageSize > 0 ? _options.Value.MaxPageSize : pageSize; var maxPageSize = _options.Value.MaxPageSize > 0 ? _options.Value.MaxPageSize : pageSize;
if (ResultCountBeForeApplyPagination==0) if (ResultCountBeForeApplyPagination==0)
{ {
ResultCountBeForeApplyPagination = result.Count(); try
{
ResultCountBeForeApplyPagination = result != null ? result.Count() : 0;
}
catch (Exception)
{
ResultCountBeForeApplyPagination = 0;
}
} }
if (pageSize > 0) if (pageSize > 0)
......
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