I am getting an Issue when trying to fetch the events from Office 365 Calendar The issue is that I am able to fetch only 10 Events and eventsResult.MorePagesAvailable is always false
I have more than 50 meetings in a month and the eventsResult is fetching only 10
Code to fetch Events :-
var eventSource = service.Me.Calendar.Events;
if (!String.IsNullOrEmpty(calendarId))
{
eventSource = service.Me.Calendars[calendarId].GetCalendarView(lowerBounday, upperBoundary);
// lowerBounday - Start Date for fetching events from calendar
// upperBoundary - End Date for fetching events from calendar
var eventsResult = await (from i in eventSource orderby i.Start select i).ExecuteAsync();
}
Same issue is coming for fetching all Calendars I have more the 10 calendars in Office 365 but still getting only 10 with MorePagesAvailable as false. Code to fetch All Calendars :-
var allCalendars = await service.Me.Calendars.ExecuteAsync();
bool checkNextPage = false;
do
{
if (checkNextPage && allCalendars.MorePagesAvailable)
{
allCalendars = await allCalendars.GetNextPageAsync();
}
foreach (ICalendar calendar in allCalendars.CurrentPage)
{
lock (calendars)
{
calendars.Add(new CalendarData(calendar.Name, calendar.Id)
{
HasWriteAccess = true,
IsFreeBusy = true
});
}
}
if(!checkNextPage)
checkNextPage = true;
} while(allCalendars.MorePagesAvailable)
We are using Microsoft.Office365 DLL's version 1.0.35 for this code. It was working fine till 10-sept-2015. Is there anything changed with API or we are missing something? Any help would be really appreciated.
@odata.nextLink
being returned in the response. Let me see what I can find out. – Jason Johnston