瀏覽代碼

[WebApiUtils] Fixed GetMultiple count

feature/authentication-tests
Robin Thoni 9 年之前
父節點
當前提交
92ad101df8
共有 1 個檔案被更改,包括 4 行新增3 行删除
  1. 4
    3
      WebApiUtils/BusinessManager/SqlServerManager.cs

+ 4
- 3
WebApiUtils/BusinessManager/SqlServerManager.cs 查看文件

@@ -159,9 +159,10 @@ namespace iiie.WebApiUtils.BusinessManager
159 159
         {
160 160
             return Execute((db, table) =>
161 161
             {
162
-                var count = table.Count(predicate);
163
-                var results = table.OrderBy(orderBy).Where(GetGlobalSelectPredicateStatic())
164
-                    .Where(predicate).Skip(page * perPage).Take(perPage).Select(DbToDboGetStatic).ToList();
162
+                var globalPredicate = GetGlobalSelectPredicateStatic();
163
+                var count = table.Where(globalPredicate).Count(predicate);
164
+                var results = table.OrderBy(orderBy).Where(globalPredicate).Where(predicate)
165
+                    .Skip(page * perPage).Take(perPage).Select(DbToDboGetStatic).ToList();
165 166
                 var result = new DboGetMultiple<TDboGet>
166 167
                 {
167 168
                     Count = count,

Loading…
取消
儲存