Using LINQPad with Entity Framework
LINQPad lets you query Entity Framework models that you define in Visual Studio. Here's how to proceed:
- Create an ADO.NET Entity Data Model in a Visual Studio project, and build.
- From LINQPad, click Add Connection (top left) and choose Entity Framework in the bottom listbox.
LINQPad supports both DbContext and ObjectContext models..
- Click Browse and locate the assembly (DLL or EXE) that you built in step 1:
- Choose your typed DbContext/ObjectContext class and Entity Data Model:
Confirm the SQL Server and database details and click OK.
Your Conceptual Model will now show in the Schema Explorer. Right-click to start a new query:
A few notes:
- You can return to Visual Studio at any time and rebuild - LINQPad will not lock your assembly.
- LINQPad automatically refreshes the schema explorer and autocompletion cache whenever the assembly changes.
- If your assembly references other assemblies, LINQPad will pick up these, too, providing they live in the same folder.