Page 1 of 1

LinqPad can't connect using Entity Developer's typed DbContext

Posted: Sun 21 Dec 2014 19:56
by Thenrich
I am trying to create a new connection in LinqPad. The wizard asks for the assembly which has the DbContext. I enter the one using Entity Developer DbContext. However testing the connection always fails. I think LinqPad is trying to use an Entity Connection String which Entity Developer doesn't use. I have tried a regular connection string but it didn't work. I tried both constructor options in LinqPad.

If I use the regular edmx designer, LinqPad works fine.

I am guessing I need a special driver because there are drivers from other ORM vendors listed in LinqPad. Is there one from DevArt? Or how do I get LinqPad to work?

Re: LinqPad can't connect using Entity Developer's typed DbContext

Posted: Mon 22 Dec 2014 18:10
by Shalex
Please try the following approach with *.edml used in Visual Studio project:
a) enable the DbContext template and set its Fluent Mapping property to True
b) select designer surface and set its Metadata Artifact Processing property to Do Not Generate Mapping Files
c) save the model and rebuild the project
d) an example of an initialization in the Entity Framework DbContext Connection window of LinqPad
Path to Custom Assembly=D:\Projects\ConsoleApplication1\bin\Debug\ConsoleApplication1.exe
Full Type Name of Typed DbContext=TestModel.TestEntities
Via a constructor that accepts a string=Data Source=DBMSSQL\MSSQL2012;Initial Catalog=test;Integrated Security=False;Persist Security Info=True;User ID=sa

Press the Test button, the result should be "Successful". If not, specify the exact text of the error.

Re: LinqPad can't connect using Entity Developer's typed DbContext

Posted: Wed 24 Dec 2014 05:34
by Thenrich
It worked! Thanks.