问题描述
我在Outlook中有一个与使用Google日历的与会者进行的活动。当我使用图形API将事件重复范围类型从“ noEnd”更改为“ numbered”时,Google参加者的事件不会得到更新。
这是我用于将重复设置为“ noEnd”的代码:
public async System.Threading.Tasks.Task SetDailyRecurrenceForever(string ExternalID,string CalendarRefreshToken)
{
var tmpEvent = new Microsoft.Graph.Event
{
Recurrence = new PatternedRecurrence
{
Pattern = new RecurrencePattern
{
Type = RecurrencePatternType.Daily,Interval = 1,FirstDayOfWeek = Microsoft.Graph.DayOfWeek.Sunday,Index = WeekIndex.First
},Range = new RecurrenceRange
{
Type = RecurrenceRangeType.NoEnd,StartDate = new Microsoft.Graph.Date(2020,10,6),RecurrenceTimeZone = "Central Standard Time",NumberOfOccurrences = 0
}
}
};
var graphClient = await MicrosoftAuthenticationProvider.GetGraphClient(CALENDAR_CLIENT_ID,CALENDAR_CLIENT_SECRET,CALENDAR_REDIRECT_URI,CALENDAR_ACCESS_ScopES,CalendarRefreshToken)
.ConfigureAwait(false);
await graphClient.Me.Events[ExternalID]
.Request()
.UpdateAsync(tmpEvent)
.ConfigureAwait(false);
}
public async System.Threading.Tasks.Task SetDailyRecurrenceForFiveDays(string ExternalID,Range = new RecurrenceRange
{
Type = RecurrenceRangeType.Numbered,NumberOfOccurrences = 5
}
}
};
var graphClient = await MicrosoftAuthenticationProvider.GetGraphClient(CALENDAR_CLIENT_ID,CalendarRefreshToken)
.ConfigureAwait(false);
await graphClient.Me.Events[ExternalID]
.Request()
.UpdateAsync(tmpEvent)
.ConfigureAwait(false);
}
通过使用图形浏览器发送PATCH,该错误也可以重复: https://graph.microsoft.com/v1.0/me/events/{ID}
将事件更新为“ noEnd”:
{"recurrence":{"pattern":{"type":"daily","interval":1,"month":0,"dayOfMonth":0,"firstDayOfWeek":"sunday","index":"first"},"range":{"type":"noEnd","startDate":"2020-10-06","endDate":"0001-01-01","recurrenceTimeZone":"Central Standard Time","numberOfOccurrences":0}}}
将事件更新为“已编号”:
{"recurrence":{"pattern":{"type":"daily","range":{"type":"numbered","numberOfOccurrences":5}}}
以下视频显示了Google与会者遇到的行为: https://www.screencast.com/t/uhwovvZf
注意:在视频的结尾,我表明将时间间隔切换为2会导致google事件正确更新,因此,当时间间隔为1时,这尤其是个问题。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)