Search code examples
c#entity-frameworklinqpadentityframework.extended

EntityFramework.Extended with LinqPad?


I have the latest version of LinqPad and have used it's Nuget feature to import EntityFramework.Extended as I wish to perform some batch updates and deletes for better performance. Unfortunately, I'm getting the following error when attempting to call Update() or Delete() on an IQueryable object:

ArgumentException: The query must be of type ObjectQuery or DbQuery.
Parameter name: source

Has anybody else had success with this? Is this even possible?


Solution

  • LinqPad is using Linq to SQL, unless provided an external assembly. Linq to SQL is not supported by Entity Framework Extended.

    If you want to use Entity Framework in LinqPad, you will have to build an assembly with the necessary connection. Simplest would be to generate a model from the database, using Visual Studio.