4

I am new in CSOM SharePoint and I was wondering if anyone could explain the differences between ClientRuntimeContext.Load and ClientRuntimeContext.ExecuteQuery and when I should use any of them?

ale
  • 6,369
  • 7
  • 55
  • 65
Mugurel
  • 198
  • 10

1 Answers1

3

clientcontext.load loads the context with items that need to be fetched from the server. You can think of this as loading a magazine or a hopper. Usually it's required to load items that are associated with a fetch method, not a property

clientcontext.executequery will actually perform the fetch. You can think of this as pulling the trigger to fetch all the "loaded" items.

You can learn more about these methods on the MSDN page here

Mike
  • 1,412
  • 16
  • 24