[英]Microsoft Graph SDK .NET get events in range
I tried to get all the events in a certain range using the following code 我试图使用以下代码来获取所有事件在一定范围内
DateTime dateStart = DateTime.Parse("2018-07-20T11:00:00"), dateEnd = dateStart.AddDays(1);
List<QueryOption> options = new List<QueryOption>()
{
new QueryOption("startDateTime", dateStart.ToUniversalTime().ToString()),
new QueryOption("endDateTime", dateEnd.ToUniversalTime().ToString())
};
var eventsInRange = await graphClient.Me.Calendar.Events.Request(options).GetAsync();
But it returns the events in all history, not only in range. 但是它返回所有历史记录中的事件,而不仅仅是范围内的事件。 Is there a way to solve this?
有办法解决吗?
You're calling the /events
endpoint using /calendarView
parameters. 您正在使用
/calendarView
参数调用/events
端点。 You want to use the CalendarView
class: 您要使用
CalendarView
类:
var eventsInRange = await graphClient.Me
.Calendar
.CalendarView
.Request(options)
.GetAsync();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.