Ted Holden
Ted Holden

Reputation: 1

How do I use LINQPad with third party plugins?

All documentation I can find relevant to doing updates with Linqpad mentions a "SubmitChanges" function which should be global for C# code and/or expressions. Nonetheless it doesn't work; all I can get is:

The name 'SubmitChanges' does not exist in the current context

This is attempting to use LINQPad with Msoft CRM/Dynamics and the related plugin. Simple "Select" queries do work.

Upvotes: 0

Views: 1115

Answers (1)

BrokenGlass
BrokenGlass

Reputation: 161002

SubmitChanges is generally only required for 3rd party LINQ providers, such as LINQ to Entities, but not for LINQ to Objects - in that context it will save all the changes made to the underlying data store.

SubmitChanges() works on a unit of work such as a data context provided by the LINQ provider, but this doesn't exist for regular LINQ (since all changes are made in memory and don't have to be persisted anywhere).

From MSDN:

Computes the set of modified objects to be inserted, updated, or deleted, and executes the appropriate commands to implement the changes to the database.

Upvotes: 1

Related Questions