简体   繁体   中英

MS Graph SDK: Adding Parameters to CalendarView

I have the following statement in Graph Rest API that returns all events from a certain calendar within the given DateTime:

https://graph.microsoft.com/beta/me/calendars/ID/calendarView?startDateTime=2017-02-01T10:31:37Z&endDateTime=2017-02-10T10:31:37Z

How would I do this using the SDK? What I got so far:

ICalendarEventsCollectionPage retrievedEvent = await graphClient.Me.Calendars[id].CalendarView...

You can add these as QueryOptions to the request.


    QueryOption startDateTime = new QueryOption("startDateTime", "2017-02-01T10:31:37Z");
    QueryOption endDateTime = new QueryOption("endDateTime", "2017-02-10T10:31:37Z");
    List options = new List();
    options.Add(startDateTime);
    options.Add(endDateTime);

    ICalendarCalendarViewCollectionPage retrievedEvents = await graphClient
                                                                .Me
                                                                .Calendars["id"]
                                                                .CalendarView
                                                                .Request(options)
                                                                .GetAsync();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM