Nikolay Tashev
Nikolay Tashev

Reputation: 103

Microsft Graph SDK: How to remove recurrence settings from an event


I am using ASP.Net Core 3.1 and Microsoft Graph Beta 0.15. How can i delete the recurrence settings of an event.
I tried by setting the Recurrence property to null but it has no effect.

Event graph = new Event();
...
event.Recurrence = null;
await graphServiceClient.Me.Events[id].Request().UpdateAsync(event);

This is possible by executing a PATCH request through the Microsoft Graph Explorer as mentioned in this post

PATCH https://graph.microsoft.com/beta/users/me/events/{id}
Content-type: application/json

{
  "recurrence": null,
}

Any help will be appreciated, Thanks

Upvotes: 2

Views: 208

Answers (2)

Ketan Pandhare
Ketan Pandhare

Reputation: 41

Try using AdditionalData property

var additionalData = new Dictionary<string, object>();
additionalData.Add("recurrence", null); 
event.AdditionalData = additionalData;

Upvotes: 4

baywet
baywet

Reputation: 5322

This is a limitation of the SDK today as documented here. The workaround is to build the request and execute it yourself.

Upvotes: 0

Related Questions