Przeglądaj źródła

[WebApiUtils] Fixed GetMultiple count

feature/authentication-tests
Robin Thoni 9 lat temu
rodzic
commit
92ad101df8
1 zmienionych plików z 4 dodań i 3 usunięć
  1. 4
    3
      WebApiUtils/BusinessManager/SqlServerManager.cs

+ 4
- 3
WebApiUtils/BusinessManager/SqlServerManager.cs Wyświetl plik

@@ -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,

Ładowanie…
Anuluj
Zapisz