Browse Source

tests; cruddataaccess get multiple

tags/v0.1.0
Robin Thoni 7 years ago
parent
commit
0f1e2a7c77

+ 239
- 126
.idea/.idea.luticate2/.idea/workspace.xml View File

@@ -29,60 +29,58 @@
29 29
   </component>
30 30
   <component name="FileEditorManager">
31 31
     <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
32
-      <file leaf-file-name="LuGroupsDataAccessTest.cs" pinned="false" current-in-tab="false">
32
+      <file leaf-file-name="LuGroupsDataAccessTest.cs" pinned="false" current-in-tab="true">
33 33
         <entry file="file://$PROJECT_DIR$/../../Test/Auth/Groups/LuGroupsDataAccessTest.cs">
34 34
           <provider selected="true" editor-type-id="text-editor">
35
-            <state relative-caret-position="531">
36
-              <caret line="80" column="50" selection-start-line="80" selection-start-column="50" selection-end-line="80" selection-end-column="50" />
35
+            <state relative-caret-position="513">
36
+              <caret line="122" column="64" selection-start-line="122" selection-start-column="64" selection-end-line="122" selection-end-column="64" />
37 37
               <folding>
38
-                <marker date="1480807031622" expanded="true" signature="6:207" ph="..." />
39
-                <marker date="1480807031622" expanded="true" signature="235:2984" ph="{...}" />
40
-                <marker date="1480807031622" expanded="true" signature="277:2982" ph="{...}" />
41
-                <marker date="1480807031622" expanded="true" signature="329:1000" ph="{...}" />
42
-                <marker date="1480807031622" expanded="true" signature="1048:1737" ph="{...}" />
43
-                <marker date="1480807031622" expanded="true" signature="1785:2348" ph="{...}" />
44
-                <marker date="1480807031622" expanded="true" signature="2396:2976" ph="{...}" />
38
+                <marker date="1480817312915" expanded="true" signature="285:4883" ph="{...}" />
39
+                <marker date="1480817312915" expanded="true" signature="327:4881" ph="{...}" />
40
+                <marker date="1480817312915" expanded="true" signature="379:1050" ph="{...}" />
41
+                <marker date="1480817312915" expanded="true" signature="1098:1787" ph="{...}" />
42
+                <marker date="1480817312915" expanded="true" signature="2446:3026" ph="{...}" />
43
+                <marker date="1480817312915" expanded="true" signature="3074:4875" ph="{...}" />
45 44
               </folding>
46 45
             </state>
47 46
           </provider>
48 47
         </entry>
49 48
       </file>
50
-      <file leaf-file-name="LuEfCrudDataAccess.cs" pinned="false" current-in-tab="true">
49
+      <file leaf-file-name="LuEfCrudDataAccess.cs" pinned="false" current-in-tab="false">
51 50
         <entry file="file://$PROJECT_DIR$/../../Luticate2.Utils/DataAccess/LuEfCrudDataAccess.cs">
52 51
           <provider selected="true" editor-type-id="text-editor">
53
-            <state relative-caret-position="308">
54
-              <caret line="73" column="46" selection-start-line="73" selection-start-column="46" selection-end-line="73" selection-end-column="46" />
52
+            <state relative-caret-position="585">
53
+              <caret line="134" column="1" selection-start-line="134" selection-start-column="1" selection-end-line="134" selection-end-column="1" />
55 54
               <folding>
56
-                <marker date="1480806940670" expanded="true" signature="6:161" ph="..." />
57
-                <marker date="1480806940670" expanded="true" signature="199:3388" ph="{...}" />
58
-                <marker date="1480806940670" expanded="true" signature="500:3386" ph="{...}" />
59
-                <marker date="1480806940670" expanded="true" signature="597:617" ph="{...}" />
60
-                <marker date="1480806940670" expanded="true" signature="920:1242" ph="{...}" />
61
-                <marker date="1480806940670" expanded="true" signature="1297:1553" ph="{...}" />
62
-                <marker date="1480806940670" expanded="true" signature="1613:1821" ph="{...}" />
63
-                <marker date="1480806940670" expanded="true" signature="1874:2130" ph="{...}" />
64
-                <marker date="1480806940670" expanded="true" signature="2188:2270" ph="{...}" />
65
-                <marker date="1480806940670" expanded="true" signature="2357:2761" ph="{...}" />
66
-                <marker date="1480806940670" expanded="true" signature="2987:3087" ph="{...}" />
67
-                <marker date="1480806940670" expanded="true" signature="3152:3222" ph="{...}" />
68
-                <marker date="1480806940670" expanded="true" signature="3280:3380" ph="{...}" />
55
+                <marker date="1480817160447" expanded="true" signature="6:161" ph="..." />
56
+                <marker date="1480817160447" expanded="true" signature="199:4916" ph="{...}" />
57
+                <marker date="1480817160447" expanded="true" signature="597:617" ph="{...}" />
58
+                <marker date="1480817160447" expanded="true" signature="920:1242" ph="{...}" />
59
+                <marker date="1480817160447" expanded="true" signature="1297:1553" ph="{...}" />
60
+                <marker date="1480817160447" expanded="true" signature="1874:2130" ph="{...}" />
61
+                <marker date="1480817160447" expanded="true" signature="2188:2270" ph="{...}" />
62
+                <marker date="1480817160447" expanded="true" signature="2357:2792" ph="{...}" />
63
+                <marker date="1480817160447" expanded="true" signature="2887:2958" ph="{...}" />
64
+                <marker date="1480817160447" expanded="true" signature="3018:3118" ph="{...}" />
65
+                <marker date="1480817160447" expanded="true" signature="3183:3253" ph="{...}" />
66
+                <marker date="1480817160447" expanded="true" signature="3311:3411" ph="{...}" />
67
+                <marker date="1480817160447" expanded="true" signature="3676:4205" ph="{...}" />
68
+                <marker date="1480817160447" expanded="true" signature="4022:4108" ph="{...}" />
69
+                <marker date="1480817160447" expanded="true" signature="4476:4590" ph="{...}" />
70
+                <marker date="1480817160447" expanded="true" signature="4807:4908" ph="{...}" />
69 71
               </folding>
70 72
             </state>
71 73
           </provider>
72 74
         </entry>
73 75
       </file>
74
-      <file leaf-file-name="LuEfDataAccess.cs" pinned="false" current-in-tab="false">
75
-        <entry file="file://$PROJECT_DIR$/../../Luticate2.Utils/DataAccess/LuEfDataAccess.cs">
76
+      <file leaf-file-name="LuPaginatedDbo.cs" pinned="false" current-in-tab="false">
77
+        <entry file="file://$PROJECT_DIR$/../../Luticate2.Utils/Dbo/LuPaginatedDbo.cs">
76 78
           <provider selected="true" editor-type-id="text-editor">
77
-            <state relative-caret-position="432">
78
-              <caret line="36" column="19" selection-start-line="36" selection-start-column="19" selection-end-line="36" selection-end-column="19" />
79
+            <state relative-caret-position="144">
80
+              <caret line="8" column="20" selection-start-line="8" selection-start-column="20" selection-end-line="8" selection-end-column="20" />
79 81
               <folding>
80
-                <marker date="1480806229174" expanded="true" signature="6:142" ph="..." />
81
-                <marker date="1480806229174" expanded="true" signature="180:1443" ph="{...}" />
82
-                <marker date="1480806229174" expanded="true" signature="324:1441" ph="{...}" />
83
-                <marker date="1480806229174" expanded="true" signature="491:559" ph="{...}" />
84
-                <marker date="1480806229174" expanded="true" signature="622:840" ph="{...}" />
85
-                <marker date="1480806229174" expanded="true" signature="952:1434" ph="{...}" />
82
+                <marker date="1480815552827" expanded="true" signature="64:212" ph="{...}" />
83
+                <marker date="1480815552827" expanded="true" signature="112:210" ph="{...}" />
86 84
               </folding>
87 85
             </state>
88 86
           </provider>
@@ -108,6 +106,7 @@
108 106
         <option value="$PROJECT_DIR$/../../Luticate2.Auth/DataAccess/code-from-ds/DataSource.twig" />
109 107
         <option value="$PROJECT_DIR$/../../Luticate2.Auth/DataAccess/LuDatabaseContext.cs" />
110 108
         <option value="$PROJECT_DIR$/../../Luticate2.Utils/DataAccess/LuEfDataAccess.cs" />
109
+        <option value="$PROJECT_DIR$/../../Luticate2.Utils/Dbo/LuPaginatedDbo.cs" />
111 110
         <option value="$PROJECT_DIR$/../../Luticate2.Utils/DataAccess/LuEfCrudDataAccess.cs" />
112 111
         <option value="$PROJECT_DIR$/../../Test/Auth/Groups/LuGroupsDataAccessTest.cs" />
113 112
       </list>
@@ -153,6 +152,24 @@
153 152
               <option name="myItemId" value="luticate2 (4 projects)" />
154 153
               <option name="myItemType" value="com.jetbrains.resharper.projectView.solutionExplorer.SolutionExplorerNodeRider" />
155 154
             </PATH_ELEMENT>
155
+            <PATH_ELEMENT>
156
+              <option name="myItemId" value="WebTest" />
157
+              <option name="myItemType" value="com.jetbrains.resharper.projectView.solutionExplorer.SolutionExplorerNodeRider" />
158
+            </PATH_ELEMENT>
159
+          </PATH>
160
+          <PATH>
161
+            <PATH_ELEMENT>
162
+              <option name="myItemId" />
163
+              <option name="myItemType" value="com.jetbrains.resharper.projectView.solutionExplorer.SolutionExplorerViewPane$ProjectViewPaneTreeStructure$createRoot$1" />
164
+            </PATH_ELEMENT>
165
+            <PATH_ELEMENT>
166
+              <option name="myItemId" value="luticate2 (4 projects)" />
167
+              <option name="myItemType" value="com.jetbrains.resharper.projectView.solutionExplorer.SolutionExplorerNodeRider" />
168
+            </PATH_ELEMENT>
169
+            <PATH_ELEMENT>
170
+              <option name="myItemId" value="Test" />
171
+              <option name="myItemType" value="com.jetbrains.resharper.projectView.solutionExplorer.SolutionExplorerNodeRider" />
172
+            </PATH_ELEMENT>
156 173
           </PATH>
157 174
           <PATH>
158 175
             <PATH_ELEMENT>
@@ -281,12 +298,12 @@
281 298
       <workItem from="1480793601520" duration="8543000" />
282 299
       <workItem from="1480804561549" duration="52000" />
283 300
       <workItem from="1480804632897" duration="16000" />
284
-      <workItem from="1480804671711" duration="2624000" />
301
+      <workItem from="1480804671711" duration="8419000" />
285 302
     </task>
286 303
     <servers />
287 304
   </component>
288 305
   <component name="TimeTrackingManager">
289
-    <option name="totallyTimeSpent" value="11235000" />
306
+    <option name="totallyTimeSpent" value="17030000" />
290 307
   </component>
291 308
   <component name="TodoView">
292 309
     <todo-panel id="selected-file">
@@ -299,29 +316,29 @@
299 316
   </component>
300 317
   <component name="ToolWindowManager">
301 318
     <frame x="0" y="0" width="1920" height="1061" extended-state="0" />
302
-    <editor active="false" />
319
+    <editor active="true" />
303 320
     <layout>
304
-      <window_info id="Change Signature" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="13" side_tool="true" content_ui="tabs" />
305
-      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.16388309" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
306 321
       <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32954547" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
307 322
       <window_info id="Errors in solution" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
308
-      <window_info id="Build" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32954547" sideWeight="0.5" order="12" side_tool="false" content_ui="tabs" />
309 323
       <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
310
-      <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.28131524" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
311 324
       <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
312
-      <window_info id="UnitTesting" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25309917" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
313
-      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
314
-      <window_info id="Terminal" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.32954547" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" />
325
+      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32954547" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
326
+      <window_info id="UnitTesting" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.25309917" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
327
+      <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32954547" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" />
315 328
       <window_info id="NuGet" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32954547" sideWeight="0.5" order="11" side_tool="false" content_ui="tabs" />
329
+      <window_info id="Change Signature" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="13" side_tool="true" content_ui="tabs" />
330
+      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.16388309" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
331
+      <window_info id="Build" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32954547" sideWeight="0.5" order="12" side_tool="false" content_ui="tabs" />
332
+      <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.28131524" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
333
+      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
334
+      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3997934" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
316 335
       <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
317 336
       <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
318 337
       <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
319 338
       <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
320
-      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32954547" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
321 339
       <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
322 340
       <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
323 341
       <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
324
-      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3997934" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
325 342
     </layout>
326 343
   </component>
327 344
   <component name="VcsContentAnnotationSettings">
@@ -339,13 +356,12 @@
339 356
         <state relative-caret-position="1134">
340 357
           <caret line="63" column="38" selection-start-line="63" selection-start-column="38" selection-end-line="63" selection-end-column="38" />
341 358
           <folding>
342
-            <marker date="1480807031622" expanded="true" signature="6:207" ph="..." />
343
-            <marker date="1480807031622" expanded="true" signature="235:2984" ph="{...}" />
344
-            <marker date="1480807031622" expanded="true" signature="277:2982" ph="{...}" />
345
-            <marker date="1480807031622" expanded="true" signature="329:1000" ph="{...}" />
346
-            <marker date="1480807031622" expanded="true" signature="1048:1737" ph="{...}" />
347
-            <marker date="1480807031622" expanded="true" signature="1785:2348" ph="{...}" />
348
-            <marker date="1480807031622" expanded="true" signature="2396:2976" ph="{...}" />
359
+            <marker date="1480817312915" expanded="true" signature="285:4883" ph="{...}" />
360
+            <marker date="1480817312915" expanded="true" signature="327:4881" ph="{...}" />
361
+            <marker date="1480817312915" expanded="true" signature="379:1050" ph="{...}" />
362
+            <marker date="1480817312915" expanded="true" signature="1098:1787" ph="{...}" />
363
+            <marker date="1480817312915" expanded="true" signature="2446:3026" ph="{...}" />
364
+            <marker date="1480817312915" expanded="true" signature="3074:4875" ph="{...}" />
349 365
           </folding>
350 366
         </state>
351 367
       </provider>
@@ -374,19 +390,22 @@
374 390
         <state relative-caret-position="828">
375 391
           <caret line="46" column="35" selection-start-line="46" selection-start-column="35" selection-end-line="46" selection-end-column="35" />
376 392
           <folding>
377
-            <marker date="1480806940670" expanded="true" signature="6:161" ph="..." />
378
-            <marker date="1480806940670" expanded="true" signature="199:3388" ph="{...}" />
379
-            <marker date="1480806940670" expanded="true" signature="500:3386" ph="{...}" />
380
-            <marker date="1480806940670" expanded="true" signature="597:617" ph="{...}" />
381
-            <marker date="1480806940670" expanded="true" signature="920:1242" ph="{...}" />
382
-            <marker date="1480806940670" expanded="true" signature="1297:1553" ph="{...}" />
383
-            <marker date="1480806940670" expanded="true" signature="1613:1821" ph="{...}" />
384
-            <marker date="1480806940670" expanded="true" signature="1874:2130" ph="{...}" />
385
-            <marker date="1480806940670" expanded="true" signature="2188:2270" ph="{...}" />
386
-            <marker date="1480806940670" expanded="true" signature="2357:2761" ph="{...}" />
387
-            <marker date="1480806940670" expanded="true" signature="2987:3087" ph="{...}" />
388
-            <marker date="1480806940670" expanded="true" signature="3152:3222" ph="{...}" />
389
-            <marker date="1480806940670" expanded="true" signature="3280:3380" ph="{...}" />
393
+            <marker date="1480817160447" expanded="true" signature="6:161" ph="..." />
394
+            <marker date="1480817160447" expanded="true" signature="199:4916" ph="{...}" />
395
+            <marker date="1480817160447" expanded="true" signature="597:617" ph="{...}" />
396
+            <marker date="1480817160447" expanded="true" signature="920:1242" ph="{...}" />
397
+            <marker date="1480817160447" expanded="true" signature="1297:1553" ph="{...}" />
398
+            <marker date="1480817160447" expanded="true" signature="1874:2130" ph="{...}" />
399
+            <marker date="1480817160447" expanded="true" signature="2188:2270" ph="{...}" />
400
+            <marker date="1480817160447" expanded="true" signature="2357:2792" ph="{...}" />
401
+            <marker date="1480817160447" expanded="true" signature="2887:2958" ph="{...}" />
402
+            <marker date="1480817160447" expanded="true" signature="3018:3118" ph="{...}" />
403
+            <marker date="1480817160447" expanded="true" signature="3183:3253" ph="{...}" />
404
+            <marker date="1480817160447" expanded="true" signature="3311:3411" ph="{...}" />
405
+            <marker date="1480817160447" expanded="true" signature="3676:4205" ph="{...}" />
406
+            <marker date="1480817160447" expanded="true" signature="4022:4108" ph="{...}" />
407
+            <marker date="1480817160447" expanded="true" signature="4476:4590" ph="{...}" />
408
+            <marker date="1480817160447" expanded="true" signature="4807:4908" ph="{...}" />
390 409
           </folding>
391 410
         </state>
392 411
       </provider>
@@ -396,13 +415,12 @@
396 415
         <state relative-caret-position="1134">
397 416
           <caret line="63" column="38" selection-start-line="63" selection-start-column="38" selection-end-line="63" selection-end-column="38" />
398 417
           <folding>
399
-            <marker date="1480807031622" expanded="true" signature="6:207" ph="..." />
400
-            <marker date="1480807031622" expanded="true" signature="235:2984" ph="{...}" />
401
-            <marker date="1480807031622" expanded="true" signature="277:2982" ph="{...}" />
402
-            <marker date="1480807031622" expanded="true" signature="329:1000" ph="{...}" />
403
-            <marker date="1480807031622" expanded="true" signature="1048:1737" ph="{...}" />
404
-            <marker date="1480807031622" expanded="true" signature="1785:2348" ph="{...}" />
405
-            <marker date="1480807031622" expanded="true" signature="2396:2976" ph="{...}" />
418
+            <marker date="1480817312915" expanded="true" signature="285:4883" ph="{...}" />
419
+            <marker date="1480817312915" expanded="true" signature="327:4881" ph="{...}" />
420
+            <marker date="1480817312915" expanded="true" signature="379:1050" ph="{...}" />
421
+            <marker date="1480817312915" expanded="true" signature="1098:1787" ph="{...}" />
422
+            <marker date="1480817312915" expanded="true" signature="2446:3026" ph="{...}" />
423
+            <marker date="1480817312915" expanded="true" signature="3074:4875" ph="{...}" />
406 424
           </folding>
407 425
         </state>
408 426
       </provider>
@@ -431,19 +449,22 @@
431 449
         <state relative-caret-position="828">
432 450
           <caret line="46" column="35" selection-start-line="46" selection-start-column="35" selection-end-line="46" selection-end-column="35" />
433 451
           <folding>
434
-            <marker date="1480806940670" expanded="true" signature="6:161" ph="..." />
435
-            <marker date="1480806940670" expanded="true" signature="199:3388" ph="{...}" />
436
-            <marker date="1480806940670" expanded="true" signature="500:3386" ph="{...}" />
437
-            <marker date="1480806940670" expanded="true" signature="597:617" ph="{...}" />
438
-            <marker date="1480806940670" expanded="true" signature="920:1242" ph="{...}" />
439
-            <marker date="1480806940670" expanded="true" signature="1297:1553" ph="{...}" />
440
-            <marker date="1480806940670" expanded="true" signature="1613:1821" ph="{...}" />
441
-            <marker date="1480806940670" expanded="true" signature="1874:2130" ph="{...}" />
442
-            <marker date="1480806940670" expanded="true" signature="2188:2270" ph="{...}" />
443
-            <marker date="1480806940670" expanded="true" signature="2357:2761" ph="{...}" />
444
-            <marker date="1480806940670" expanded="true" signature="2987:3087" ph="{...}" />
445
-            <marker date="1480806940670" expanded="true" signature="3152:3222" ph="{...}" />
446
-            <marker date="1480806940670" expanded="true" signature="3280:3380" ph="{...}" />
452
+            <marker date="1480817160447" expanded="true" signature="6:161" ph="..." />
453
+            <marker date="1480817160447" expanded="true" signature="199:4916" ph="{...}" />
454
+            <marker date="1480817160447" expanded="true" signature="597:617" ph="{...}" />
455
+            <marker date="1480817160447" expanded="true" signature="920:1242" ph="{...}" />
456
+            <marker date="1480817160447" expanded="true" signature="1297:1553" ph="{...}" />
457
+            <marker date="1480817160447" expanded="true" signature="1874:2130" ph="{...}" />
458
+            <marker date="1480817160447" expanded="true" signature="2188:2270" ph="{...}" />
459
+            <marker date="1480817160447" expanded="true" signature="2357:2792" ph="{...}" />
460
+            <marker date="1480817160447" expanded="true" signature="2887:2958" ph="{...}" />
461
+            <marker date="1480817160447" expanded="true" signature="3018:3118" ph="{...}" />
462
+            <marker date="1480817160447" expanded="true" signature="3183:3253" ph="{...}" />
463
+            <marker date="1480817160447" expanded="true" signature="3311:3411" ph="{...}" />
464
+            <marker date="1480817160447" expanded="true" signature="3676:4205" ph="{...}" />
465
+            <marker date="1480817160447" expanded="true" signature="4022:4108" ph="{...}" />
466
+            <marker date="1480817160447" expanded="true" signature="4476:4590" ph="{...}" />
467
+            <marker date="1480817160447" expanded="true" signature="4807:4908" ph="{...}" />
447 468
           </folding>
448 469
         </state>
449 470
       </provider>
@@ -498,13 +519,6 @@
498 519
         </state>
499 520
       </provider>
500 521
     </entry>
501
-    <entry file="file://$PROJECT_DIR$/../../Test/project.json">
502
-      <provider selected="true" editor-type-id="text-editor">
503
-        <state relative-caret-position="162">
504
-          <caret line="9" column="17" selection-start-line="9" selection-start-column="17" selection-end-line="9" selection-end-column="17" />
505
-        </state>
506
-      </provider>
507
-    </entry>
508 522
     <entry file="file://$PROJECT_DIR$/../../Luticate2.Utils/Dbo/LuResult.cs">
509 523
       <provider selected="true" editor-type-id="text-editor">
510 524
         <state relative-caret-position="-11">
@@ -574,22 +588,6 @@
574 588
         </state>
575 589
       </provider>
576 590
     </entry>
577
-    <entry file="file://$PROJECT_DIR$/../../Test/Auth/Groups/LuGroupsDataAccessTest.cs">
578
-      <provider selected="true" editor-type-id="text-editor">
579
-        <state relative-caret-position="531">
580
-          <caret line="80" column="50" selection-start-line="80" selection-start-column="50" selection-end-line="80" selection-end-column="50" />
581
-          <folding>
582
-            <marker date="1480807031622" expanded="true" signature="6:207" ph="..." />
583
-            <marker date="1480807031622" expanded="true" signature="235:2984" ph="{...}" />
584
-            <marker date="1480807031622" expanded="true" signature="277:2982" ph="{...}" />
585
-            <marker date="1480807031622" expanded="true" signature="329:1000" ph="{...}" />
586
-            <marker date="1480807031622" expanded="true" signature="1048:1737" ph="{...}" />
587
-            <marker date="1480807031622" expanded="true" signature="1785:2348" ph="{...}" />
588
-            <marker date="1480807031622" expanded="true" signature="2396:2976" ph="{...}" />
589
-          </folding>
590
-        </state>
591
-      </provider>
592
-    </entry>
593 591
     <entry file="file://$PROJECT_DIR$/../../Luticate2.Utils/DataAccess/LuEfDataAccess.cs">
594 592
       <provider selected="true" editor-type-id="text-editor">
595 593
         <state relative-caret-position="432">
@@ -605,24 +603,139 @@
605 603
         </state>
606 604
       </provider>
607 605
     </entry>
606
+    <entry file="file://$PROJECT_DIR$/../../Luticate2.Utils/project.json">
607
+      <provider selected="true" editor-type-id="text-editor">
608
+        <state relative-caret-position="0">
609
+          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
610
+          <folding>
611
+            <marker date="1480746033050" expanded="true" signature="0:595" ph="{...}" />
612
+            <marker date="1480746033050" expanded="true" signature="46:85" ph="{...}" />
613
+            <marker date="1480746033050" expanded="true" signature="107:423" ph="{...}" />
614
+            <marker date="1480746033050" expanded="true" signature="443:593" ph="{...}" />
615
+            <marker date="1480746033050" expanded="true" signature="470:587" ph="{...}" />
616
+            <marker date="1480746033050" expanded="true" signature="495:577" ph="[...]" />
617
+          </folding>
618
+        </state>
619
+      </provider>
620
+    </entry>
621
+    <entry file="file://$PROJECT_DIR$/../../Luticate2.Auth/project.json">
622
+      <provider selected="true" editor-type-id="text-editor">
623
+        <state relative-caret-position="0">
624
+          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
625
+          <folding>
626
+            <marker date="1480745331422" expanded="true" signature="0:321" ph="{...}" />
627
+            <marker date="1480745331422" expanded="true" signature="46:85" ph="{...}" />
628
+            <marker date="1480745331422" expanded="true" signature="107:149" ph="{...}" />
629
+            <marker date="1480745331422" expanded="true" signature="169:319" ph="{...}" />
630
+            <marker date="1480745331422" expanded="true" signature="196:313" ph="{...}" />
631
+            <marker date="1480745331422" expanded="true" signature="221:303" ph="[...]" />
632
+          </folding>
633
+        </state>
634
+      </provider>
635
+    </entry>
636
+    <entry file="file://$PROJECT_DIR$/../../Test/project.json">
637
+      <provider selected="true" editor-type-id="text-editor">
638
+        <state relative-caret-position="0">
639
+          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
640
+          <folding>
641
+            <marker date="1480799618637" expanded="true" signature="0:580" ph="{...}" />
642
+            <marker date="1480799618637" expanded="true" signature="44:77" ph="{...}" />
643
+            <marker date="1480799618637" expanded="true" signature="97:285" ph="{...}" />
644
+            <marker date="1480799618637" expanded="true" signature="328:578" ph="{...}" />
645
+            <marker date="1480799618637" expanded="true" signature="351:574" ph="{...}" />
646
+            <marker date="1480799618637" expanded="true" signature="375:488" ph="{...}" />
647
+            <marker date="1480799618637" expanded="true" signature="410:480" ph="{...}" />
648
+            <marker date="1480799618637" expanded="true" signature="507:568" ph="[...]" />
649
+          </folding>
650
+        </state>
651
+      </provider>
652
+    </entry>
653
+    <entry file="file://$PROJECT_DIR$/../../WebTest/project.json">
654
+      <provider selected="true" editor-type-id="text-editor">
655
+        <state relative-caret-position="0">
656
+          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
657
+          <folding>
658
+            <marker date="1480799016813" expanded="true" signature="0:1537" ph="{...}" />
659
+            <marker date="1480799016813" expanded="true" signature="20:810" ph="{...}" />
660
+            <marker date="1480799016813" expanded="true" signature="748:806" ph="{...}" />
661
+            <marker date="1480799016813" expanded="true" signature="823:907" ph="{...}" />
662
+            <marker date="1480799016813" expanded="true" signature="925:1037" ph="{...}" />
663
+            <marker date="1480799016813" expanded="true" signature="948:1033" ph="{...}" />
664
+            <marker date="1480799016813" expanded="true" signature="967:1027" ph="[...]" />
665
+            <marker date="1480799016813" expanded="true" signature="1057:1158" ph="{...}" />
666
+            <marker date="1480799016813" expanded="true" signature="1180:1248" ph="{...}" />
667
+            <marker date="1480799016813" expanded="true" signature="1206:1244" ph="{...}" />
668
+            <marker date="1480799016813" expanded="true" signature="1270:1381" ph="{...}" />
669
+            <marker date="1480799016813" expanded="true" signature="1287:1377" ph="[...]" />
670
+            <marker date="1480799016813" expanded="true" signature="1396:1535" ph="{...}" />
671
+            <marker date="1480799016813" expanded="true" signature="1417:1531" ph="[...]" />
672
+          </folding>
673
+        </state>
674
+      </provider>
675
+    </entry>
676
+    <entry file="file://$USER_HOME$/.local/share/JetBrains/Shared/v07/DecompilerCache/decompiler/840DEC66-09A9-43BA-92B5-EA8E4D456014/fd/27d496fb/ICollection`1.cs">
677
+      <provider selected="true" editor-type-id="text-editor">
678
+        <state relative-caret-position="-126">
679
+          <caret line="11" column="19" selection-start-line="11" selection-start-column="19" selection-end-line="11" selection-end-column="19" />
680
+          <folding />
681
+        </state>
682
+      </provider>
683
+    </entry>
684
+    <entry file="file://$USER_HOME$/.local/share/JetBrains/Shared/v07/DecompilerCache/decompiler/3CC77FAF-3A9A-45C1-AC27-18C03FA91A36/0b/67a717b1/Queryable.cs">
685
+      <provider selected="true" editor-type-id="text-editor">
686
+        <state relative-caret-position="231">
687
+          <caret line="939" column="45" selection-start-line="939" selection-start-column="45" selection-end-line="939" selection-end-column="45" />
688
+          <folding />
689
+        </state>
690
+      </provider>
691
+    </entry>
692
+    <entry file="file://$PROJECT_DIR$/../../Luticate2.Utils/Dbo/LuPaginatedDbo.cs">
693
+      <provider selected="true" editor-type-id="text-editor">
694
+        <state relative-caret-position="144">
695
+          <caret line="8" column="20" selection-start-line="8" selection-start-column="20" selection-end-line="8" selection-end-column="20" />
696
+          <folding>
697
+            <marker date="1480815552827" expanded="true" signature="64:212" ph="{...}" />
698
+            <marker date="1480815552827" expanded="true" signature="112:210" ph="{...}" />
699
+          </folding>
700
+        </state>
701
+      </provider>
702
+    </entry>
608 703
     <entry file="file://$PROJECT_DIR$/../../Luticate2.Utils/DataAccess/LuEfCrudDataAccess.cs">
609 704
       <provider selected="true" editor-type-id="text-editor">
610
-        <state relative-caret-position="308">
611
-          <caret line="73" column="46" selection-start-line="73" selection-start-column="46" selection-end-line="73" selection-end-column="46" />
705
+        <state relative-caret-position="585">
706
+          <caret line="134" column="1" selection-start-line="134" selection-start-column="1" selection-end-line="134" selection-end-column="1" />
707
+          <folding>
708
+            <marker date="1480817160447" expanded="true" signature="6:161" ph="..." />
709
+            <marker date="1480817160447" expanded="true" signature="199:4916" ph="{...}" />
710
+            <marker date="1480817160447" expanded="true" signature="597:617" ph="{...}" />
711
+            <marker date="1480817160447" expanded="true" signature="920:1242" ph="{...}" />
712
+            <marker date="1480817160447" expanded="true" signature="1297:1553" ph="{...}" />
713
+            <marker date="1480817160447" expanded="true" signature="1874:2130" ph="{...}" />
714
+            <marker date="1480817160447" expanded="true" signature="2188:2270" ph="{...}" />
715
+            <marker date="1480817160447" expanded="true" signature="2357:2792" ph="{...}" />
716
+            <marker date="1480817160447" expanded="true" signature="2887:2958" ph="{...}" />
717
+            <marker date="1480817160447" expanded="true" signature="3018:3118" ph="{...}" />
718
+            <marker date="1480817160447" expanded="true" signature="3183:3253" ph="{...}" />
719
+            <marker date="1480817160447" expanded="true" signature="3311:3411" ph="{...}" />
720
+            <marker date="1480817160447" expanded="true" signature="3676:4205" ph="{...}" />
721
+            <marker date="1480817160447" expanded="true" signature="4022:4108" ph="{...}" />
722
+            <marker date="1480817160447" expanded="true" signature="4476:4590" ph="{...}" />
723
+            <marker date="1480817160447" expanded="true" signature="4807:4908" ph="{...}" />
724
+          </folding>
725
+        </state>
726
+      </provider>
727
+    </entry>
728
+    <entry file="file://$PROJECT_DIR$/../../Test/Auth/Groups/LuGroupsDataAccessTest.cs">
729
+      <provider selected="true" editor-type-id="text-editor">
730
+        <state relative-caret-position="513">
731
+          <caret line="122" column="64" selection-start-line="122" selection-start-column="64" selection-end-line="122" selection-end-column="64" />
612 732
           <folding>
613
-            <marker date="1480806940670" expanded="true" signature="6:161" ph="..." />
614
-            <marker date="1480806940670" expanded="true" signature="199:3388" ph="{...}" />
615
-            <marker date="1480806940670" expanded="true" signature="500:3386" ph="{...}" />
616
-            <marker date="1480806940670" expanded="true" signature="597:617" ph="{...}" />
617
-            <marker date="1480806940670" expanded="true" signature="920:1242" ph="{...}" />
618
-            <marker date="1480806940670" expanded="true" signature="1297:1553" ph="{...}" />
619
-            <marker date="1480806940670" expanded="true" signature="1613:1821" ph="{...}" />
620
-            <marker date="1480806940670" expanded="true" signature="1874:2130" ph="{...}" />
621
-            <marker date="1480806940670" expanded="true" signature="2188:2270" ph="{...}" />
622
-            <marker date="1480806940670" expanded="true" signature="2357:2761" ph="{...}" />
623
-            <marker date="1480806940670" expanded="true" signature="2987:3087" ph="{...}" />
624
-            <marker date="1480806940670" expanded="true" signature="3152:3222" ph="{...}" />
625
-            <marker date="1480806940670" expanded="true" signature="3280:3380" ph="{...}" />
733
+            <marker date="1480817312915" expanded="true" signature="285:4883" ph="{...}" />
734
+            <marker date="1480817312915" expanded="true" signature="327:4881" ph="{...}" />
735
+            <marker date="1480817312915" expanded="true" signature="379:1050" ph="{...}" />
736
+            <marker date="1480817312915" expanded="true" signature="1098:1787" ph="{...}" />
737
+            <marker date="1480817312915" expanded="true" signature="2446:3026" ph="{...}" />
738
+            <marker date="1480817312915" expanded="true" signature="3074:4875" ph="{...}" />
626 739
           </folding>
627 740
         </state>
628 741
       </provider>

+ 32
- 1
Luticate2.Utils/DataAccess/LuEfCrudDataAccess.cs View File

@@ -76,7 +76,8 @@ namespace Luticate2.Utils.DataAccess
76 76
                 {
77 77
                     return LuResult<TDboRead>.Error(LuStatus.NotFound, typeof(TModel).Name + ": Value not found", "");
78 78
                 }
79
-                return LuResult<TDboRead>.Ok(GetDboFromModel(model));
79
+                var dbo = GetDboFromModel(model);
80
+                return LuResult<TDboRead>.Ok(dbo);
80 81
             });
81 82
         }
82 83
 
@@ -99,5 +100,35 @@ namespace Luticate2.Utils.DataAccess
99 100
         {
100 101
             return GetSingleByKeys(new KeyValuePair<string, object>("id", id));
101 102
         }
103
+
104
+        public LuResult<LuPaginatedDbo<TDboRead>> GetMultiple<TKey>(Func<IQueryable<TModel>> orderBy,
105
+            Expression<Func<TModel, bool>> predicate, int page = 0, int perPage = int.MaxValue,
106
+            params Expression<Func<TModel, TKey>>[] otherOrderBy)
107
+        {
108
+            return Execute(() =>
109
+            {
110
+                var count = Table.Count(predicate);
111
+                var ordered = orderBy();
112
+                var data = ordered.Where(predicate).Skip(page * perPage).Take(perPage).Select(GetDboFromModel).ToList();
113
+                var result = new LuPaginatedDbo<TDboRead>
114
+                {
115
+                    Count = count,
116
+                    Data = data
117
+                };
118
+                return LuResult<LuPaginatedDbo<TDboRead>>.Ok(result);
119
+            });
120
+        }
121
+
122
+        public LuResult<LuPaginatedDbo<TDboRead>> GetMultiple<TKey>(Expression<Func<TModel, TKey>> orderBy,
123
+            Expression<Func<TModel, bool>> predicate, int page = 0, int perPage = int.MaxValue)
124
+        {
125
+            return GetMultiple<TKey>(() => Table.OrderBy(orderBy), predicate, page, perPage);
126
+        }
127
+
128
+        public LuResult<LuPaginatedDbo<TDboRead>> GetMultiple<TKey>(Expression<Func<TModel, TKey>> orderBy,
129
+            int page = 0, int perPage = int.MaxValue)
130
+        {
131
+            return GetMultiple(orderBy, x => true, page, perPage);
132
+        }
102 133
     }
103 134
 }

+ 6
- 2
Luticate2.Utils/Dbo/LuPaginatedDbo.cs View File

@@ -1,7 +1,11 @@
1
-namespace Luticate2.Utils.Dbo
1
+using System.Collections.Generic;
2
+
3
+namespace Luticate2.Utils.Dbo
2 4
 {
3
-    public class LuPaginatedDbo : LuDbo
5
+    public class LuPaginatedDbo<TDbo> : LuDbo
4 6
     {
7
+        public long Count { get; set; }
5 8
 
9
+        public List<TDbo> Data { get; set; }
6 10
     }
7 11
 }

+ 42
- 0
Test/Auth/Groups/LuGroupsDataAccessTest.cs View File

@@ -1,4 +1,6 @@
1 1
 using System;
2
+using System.Linq;
3
+using System.Linq.Expressions;
2 4
 using Luticate2.Auth.DataAccess;
3 5
 using Luticate2.Auth.DataAccess.Models;
4 6
 using Luticate2.Auth.Dbo.Groups;
@@ -81,5 +83,45 @@ namespace Test.Auth.Groups
81 83
                 Assert.Equal(name, get.Data.Name);
82 84
             });
83 85
         }
86
+
87
+        [Fact]
88
+        public void TestReal4()
89
+        {
90
+            Tests.TestRealDb(context =>
91
+            {
92
+                string[] names = {"001-Test.", "010-Test.", "030-Test.", "020-Test.", "000-Test."};
93
+                var service = new LuGroupsDataAccess(context);
94
+                foreach (var name in names)
95
+                {
96
+                    var res = service.AddGuidStr(new LuGroupsAddDbo {Name = name});
97
+                    Assert.Equal(LuStatus.Success, res.Status);
98
+                    Assert.NotEqual(new Guid().ToString(), res.Data);
99
+                }
100
+
101
+                var get = service.GetMultiple(groups => groups.name, 0, 2);
102
+                Assert.Equal(LuStatus.Success, get.Status);
103
+                Assert.Equal(5, get.Data.Count);
104
+                Assert.Equal(2, get.Data.Data.Count);
105
+                Assert.Equal("000-Test.", get.Data.Data[0].Name);
106
+                Assert.Equal("001-Test.", get.Data.Data[1].Name);
107
+
108
+                get = service.GetMultiple(groups => groups.name, 2, 2);
109
+                Assert.Equal(LuStatus.Success, get.Status);
110
+                Assert.Equal(5, get.Data.Count);
111
+                Assert.Equal(1, get.Data.Data.Count);
112
+                Assert.Equal("030-Test.", get.Data.Data[0].Name);
113
+
114
+                get = service.GetMultiple(groups => groups.name, 3, 2);
115
+                Assert.Equal(LuStatus.Success, get.Status);
116
+                Assert.Equal(5, get.Data.Count);
117
+                Assert.Equal(0, get.Data.Data.Count);
118
+
119
+                get = service.GetMultiple(groups => groups.name, groups => groups.name.Contains("0-"), 1, 1);
120
+                Assert.Equal(LuStatus.Success, get.Status);
121
+                Assert.Equal(4, get.Data.Count);
122
+                Assert.Equal(1, get.Data.Data.Count);
123
+                Assert.Equal("010-Test.", get.Data.Data[0].Name);
124
+            });
125
+        }
84 126
     }
85 127
 }

Loading…
Cancel
Save