-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
36 lines (28 loc) · 772 Bytes
/
Copy pathProgram.cs
File metadata and controls
36 lines (28 loc) · 772 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using ChargeBee.Api;
using ChargeBee.Models;
using Newtonsoft.Json;
class Program
{
static async Task Main(string[] args)
{
ApiConfig.Configure("test-site", "test_api_key");
await Pagination();
}
static async Task<List<Event>> Pagination()
{
var events = new List<Event>();
const int pageSize = 100;
string offset = null;
do
{
var result = await Event
.List()
.Offset(offset)
.Limit(pageSize)
.RequestAsync();
offset = result.NextOffset;
events.AddRange(result.List.Select(x => x.Event));
} while (offset != null);
return events;
}
}