How can I put the LINQ to SQL generated classes in a dedicated DAL project so that I can access it from various other projects in the same solution? I.e. so I can use one for Web, and one for Windows Forms?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Absolutely no problem – just create a “class library” project and create your DBML file (LINQ-to-SQL file) in there.
Now, from all your projects that need this particular Linq-to-SQL file, add a reference to that class library assembly, and use the classes – and you’re done!
The Linq-to-SQL DBMX file and its associated classes are just pure C# business objects and methods – there’s nothing web- or Winforms-specific about those – you can use those in Winforms, WPF, Web Forms, ASP.NET MVC – you name it.
Marc