Sameer Joshi
Sameer Joshi

Reputation: 87

Google calendar API Execute() and Fetch() in .Net

In all the samples of google calendar I am seeing like

service.Events.Insert(body,id).Execute()

But When I am using the API in my code I am getting like

service.Events.Insert(body,id).Fetch()

Please help me to get understand what is the difference in these two things. I am able to Insert the events in google calendar with Fetch method.

and tell me Whether I am using a correct API dlls

Upvotes: 1

Views: 86

Answers (1)

AL.
AL.

Reputation: 37798

You are able to Insert the Event in Google Calendar by using both methods since you are calling the Insert function on both. Notice in the code you provided that Events.Insert is included in both.

Regarding the difference of .Execute() and .Fetch(), I've done a LOT of digging, but I wasn't able to find a clear document that describes what it technically does, however I'll just go on ahead and provide the descriptions I found that I think best defines them, based on the sites I've visited. What I think is that both have a relation the execution of a query.

.Execute() - a native language capability in .NET (LINQ - Language Integrated Query), which is commonly used to execute a query. Got it from this reference site.

.Fetch() - similar to .Execute(), it executes the provided query and is also used to get references. Found this post that mentions the difference of Fetch vs FetchMany.

Hope this gives you an idea on what it does somehow. Good luck.

Upvotes: 1

Related Questions