Reputation: 584
I have this method:
public static void DeleteEvent(CalendarService service, Event eventToDelete, string calendarId = "primary")
{
service.Events.Delete(calendarId, eventToDelete.Id);
}
but it's failing to delete any events from the calendar.
What's am I doing wrong?
Upvotes: 3
Views: 2520
Reputation: 29006
What you need to do is Add an .Execute()
at the End of the line to execute the delete command, then it will be like the following:
service.Events.Delete(calendarId, eventToDelete.Id).Execute();
You can refer this article as well for more informations
Upvotes: 4