@@ -108,7 +108,6 @@ ctx.Load(web);
108
108
Entity entity = ctx .Web .GetEntity (" http://sharepointservername" , " EntityName" );
109
109
ctx .Load (entity );
110
110
ctx .ExecuteQuery ();
111
-
112
111
```
113
112
114
113
@@ -120,11 +119,28 @@ This example shows how to write a generic invoker so that you can create an enti
120
119
121
120
122
121
``` cs
123
-
124
- ObjectCollection myObj ;
125
- entity .Execute (" MethodInstanceName" , lsi , myObj );
126
- ctx .Load (myObj );
127
- ctx .ExecuteQuery ();
122
+ LobSystem lobSystem = entity .GetLobSystem ();
123
+ ctx .Load (lobSystem );
124
+
125
+ LobSystemInstanceCollection lobInstances = lobSystem .GetLobSystemInstances ();
126
+ ctx .Load (lobInstances );
127
+ ctx .ExecuteQuery ();
128
+
129
+ LobSystemInstance lsi ;
130
+ foreach (LobSystemInstance lobInstance in lobInstances )
131
+ {
132
+ if (lobInstance .Name .CompareTo (" MyLOBSystemInstance" ) == 0 )
133
+ {
134
+ lsi = lobInstance ;
135
+ }
136
+ }
137
+
138
+ if (null != lsi )
139
+ {
140
+ entity .Execute (" MethodInstanceName" , lsi , Array .Empty <object >());
141
+ ctx .Load (myObj );
142
+ ctx .ExecuteQuery ();
143
+ }
128
144
129
145
```
130
146
@@ -142,21 +158,12 @@ The following example shows how to retrieve a filtered, paged dataset. In this c
142
158
FilterCollection fCollection = entity .GetFilters (" methodName" );
143
159
ctx .Load (fCollection );
144
160
ctx .ExecuteQuery ();
145
- FilterCollection modifiedFCollection = new FilterCollection ();
146
- foreach ( Filter filter in fCollection )
147
- {
148
- if ( filter .FilterField .equals (" X.Y.Z.Country" ))
149
- {
150
- filter .FilterValue = " India" ;
151
- modifiedFCollection .Add (Filter );
152
- }
153
- if (filter .FilterType == FilterType .Limit )
154
- {
155
- filter .FilterValue = 50 ;
156
- modifiedFCollection .Add (Filter );
157
- }
158
- }
159
- EntityInstanceCollection eCollection = entity .FindFiltered (modifiedFCollection ,
161
+
162
+ fCollection .SetFilterValue (" X.Y.Z.Country" , 0 , " India" )
163
+ // Assuming that the "RowLimit" filter has the Limit filter type
164
+ fCollection .SetFilterValue (" RowLimit" , 0 , 50 )
165
+
166
+ EntityInstanceCollection eCollection = entity .FindFiltered (fCollection ,
160
167
" nameOfFinder" , lsi );
161
168
ctx .ExecuteQuery ();
162
169
@@ -176,16 +183,10 @@ The following example demonstrates how to return a filtered result set. In this
176
183
FilterCollection fCollection = entity .GetFilters (" methodName" );
177
184
ctx .Load (fCollection );
178
185
ctx .ExecuteQuery ();
179
- FilterCollection modifiedFCollection = new FilterCollection ();
180
- foreach ( Filter filter in fCollection )
181
- {
182
- if ( filter .FilterField .equals (" X.Y.Z.Country" ))
183
- {
184
- filter .FilterValue = " India" ;
185
- modifiedFCollection .Add (Filter );
186
- }
187
- }
188
- EntityInstanceCollection eCollection = entity .FindFiltered (modifiedFCollection ,
186
+
187
+ fCollection .SetFilterValue (" X.Y.Z.Country" , 0 , " India" )
188
+
189
+ EntityInstanceCollection eCollection = entity .FindFiltered (fCollection ,
189
190
" nameOfFinder" , lsi );
190
191
ctx .ExecuteQuery ();
191
192
0 commit comments