Skip to content

Commit 99e7372

Browse files
committed
docs: add portal limit/offset examples
1 parent 3aaa7f2 commit 99e7372

2 files changed

Lines changed: 74 additions & 0 deletions

File tree

README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,43 @@ var (data, info) = await fdc.SendAsync(req, true);
192192

193193
Alternatively, if you create a calculated field `Get(RecordID)` and put it on your layout then map it the normal way.
194194

195+
### Find with Portal Limit and Offset
196+
197+
By default, the FileMaker Data API limits portal records to 50 per request. You can control per-portal `limit` and `offset` using the fluent `WithPortal` builder or `ConfigurePortal` method on `FindRequest<T>`.
198+
199+
Use the fluent builder to chain portal configuration:
200+
201+
```csharp
202+
var req = new FindRequest<Model>() { Layout = "layout" };
203+
req.AddQuery(new Model { Name = "someName" }, false);
204+
205+
// configure portals with limit and offset
206+
req.WithPortal("RelatedInvoices").Limit(100).Offset(1)
207+
.WithPortal("LineItems").Limit(200);
208+
209+
var results = await client.SendAsync(req);
210+
```
211+
212+
Or use `ConfigurePortal` directly:
213+
214+
```csharp
215+
var req = new FindRequest<Model>() { Layout = "layout" };
216+
req.AddQuery(new Model { Name = "someName" }, false);
217+
req.ConfigurePortal("RelatedInvoices", limit: 100, offset: 1);
218+
var results = await client.SendAsync(req);
219+
```
220+
221+
To include specific portals in the response without setting limits:
222+
223+
```csharp
224+
var req = new FindRequest<Model>() { Layout = "layout" };
225+
req.AddQuery(new Model { Name = "someName" }, false);
226+
req.IncludePortals("RelatedInvoices", "LineItems");
227+
var results = await client.SendAsync(req);
228+
```
229+
230+
Portal parameters work with both find requests (POST to `_find`) and empty-query get-records requests (GET).
231+
195232
### Find and load Container Data
196233

197234
Make sure you use the `[ContainerDataFor("NameOfContainer")]` attribute along with a `byte[]` property for processing of your model.

docs/example-use.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,43 @@ var (data, info) = await fdc.SendAsync(req, true);
148148

149149
Alternatively, if you create a calculated field `Get(RecordID)` and put it on your layout then map it the normal way.
150150

151+
### Find with Portal Limit and Offset
152+
153+
By default, the FileMaker Data API limits portal records to 50 per request. You can control per-portal `limit` and `offset` using the fluent `WithPortal` builder or `ConfigurePortal` method on `FindRequest<T>`.
154+
155+
Use the fluent builder to chain portal configuration:
156+
157+
```csharp
158+
var req = new FindRequest<Model>() { Layout = "layout" };
159+
req.AddQuery(new Model { Name = "someName" }, false);
160+
161+
// configure portals with limit and offset
162+
req.WithPortal("RelatedInvoices").Limit(100).Offset(1)
163+
.WithPortal("LineItems").Limit(200);
164+
165+
var results = await client.SendAsync(req);
166+
```
167+
168+
Or use `ConfigurePortal` directly:
169+
170+
```csharp
171+
var req = new FindRequest<Model>() { Layout = "layout" };
172+
req.AddQuery(new Model { Name = "someName" }, false);
173+
req.ConfigurePortal("RelatedInvoices", limit: 100, offset: 1);
174+
var results = await client.SendAsync(req);
175+
```
176+
177+
To include specific portals in the response without setting limits:
178+
179+
```csharp
180+
var req = new FindRequest<Model>() { Layout = "layout" };
181+
req.AddQuery(new Model { Name = "someName" }, false);
182+
req.IncludePortals("RelatedInvoices", "LineItems");
183+
var results = await client.SendAsync(req);
184+
```
185+
186+
Portal parameters work with both find requests (POST to `_find`) and empty-query get-records requests (GET).
187+
151188
### Find and load Container Data
152189

153190
Make sure you use the `[ContainerDataFor("NameOfContainer")]` attribute along with a `byte[]` property for processing of your model.

0 commit comments

Comments
 (0)