rosstripi
rosstripi

Reputation: 584

How to delete event in Google Calendar using API v3 .NET?

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

Answers (1)

sujith karivelil
sujith karivelil

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

Related Questions