Browse Source

[WebApiUtils] Fixed GetMultiple count

feature/authentication-tests
Robin Thoni 9 years ago
parent
commit
92ad101df8
1 changed files with 4 additions and 3 deletions
  1. 4
    3
      WebApiUtils/BusinessManager/SqlServerManager.cs

+ 4
- 3
WebApiUtils/BusinessManager/SqlServerManager.cs View File

159
         {
159
         {
160
             return Execute((db, table) =>
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
                 var result = new DboGetMultiple<TDboGet>
166
                 var result = new DboGetMultiple<TDboGet>
166
                 {
167
                 {
167
                     Count = count,
168
                     Count = count,

Loading…
Cancel
Save