0

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?

splattne
  • 102,760
  • 52
  • 202
  • 249
Dkong
  • 2,748
  • 10
  • 54
  • 73

1 Answers1

4

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
  • 732,580
  • 175
  • 1,330
  • 1,459