Randy Minder
Randy Minder

Reputation: 48542

Why can't LinqPad autogenerate a context object with EF?

Does anyone know why LinqPad cannot autogenerate an Entity Framework context object (like it does with Linq-to-SQL)? It seems I have to create an assembly containing an EF context and then reference the assembly in LinqPad. But I don't need to do this with L2S.

Thanks very much.

Upvotes: 0

Views: 182

Answers (1)

Joe Albahari
Joe Albahari

Reputation: 31004

LINQPad uses LINQ-to-SQL for automatic data contexts because it's lighter and faster. LINQ-to-SQL also generates better SQL in many cases and allows arbitrary functions in the final projection.

It wouldn't be hard, in principle, to write a driver for Entity Framework. The reason it isn't present as an option is lack of demand.

If you wanted, you could implement EF support seamlessly as a third-party driver. The only tricky thing to implement is supporting every version of EF.

Upvotes: 1

Related Questions