Skip to content

Offset(..) throws exception for subsequently callsΒ #54

@Leh2

Description

@Leh2

When paging a given resource, it should be allowed to call Offset more than once. When doing it today we get the this exception: System.ArgumentException: An item with the same key has already been added. Key: offset.

To reproduce, use this code and make sure more than 100 events is present (or lower pageSize)

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;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions