Use Custom Dbml With Linqpad |
![]() ![]() |
Use Custom Dbml With Linqpad |
Jul 1 2009, 05:55 AM
Post
#1
|
|
|
|
I'm working on a project which references an existing database, which has no foreign keys defined, and which I can't amend in case it causes problems with the existing application. I have therefore created a custom dbml file within my asp.net website, where I have added associations between the tables.
I would like to use linqpad in order to test and develop queries, but I can't figure out how to reference the dbml file from linqpad. There is no dll in the website or project folders, so I am not sure how to reference the assembly. Any help would be greatly appreciated. Pete |
|
|
|
Jul 1 2009, 07:48 PM
Post
#2
|
|
|
Advanced Member ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 207 Joined: 15-February 08 From: Perth, Australia Member No.: 90 |
Hi Pete
You need to create a DLL that LINQPad can reference. This happens automatically if you create a web application (rather than a web site). But obviously, you're not going to want to change your solution structure just for LINQPad! So a workaround is to create an additional project (of type class library) and add just the .dbml and associated files to the project. You can put this project in a separate directory if you want, and then add the .dbml and associated items as shortcuts. Once you have a DLL, it's easy to consume it in LINQPad. The procedure is the same as for Entity Framework: http://www.linqpad.net/EntityFramework.aspx Joe |
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 7th November 2009 - 05:17 PM |