views:

133

answers:

1

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?

+4  A: 

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

marc_s