How to generate private LINQ to SQL classes?

I am trying to understand how to make the generated LINQ to SQL classes marked as private rather than public, so this is not visible outside the assembly. There seems to be no way to do this in the Visual Studio O / R designer or the SqlMetal tool unless I miss something. Is there any way to do this?

I ask because I use LINQ to SQL internally as the data access layer in the business logic assembly. I provide clients with a separate set of custom entity classes, and I do not want LINQ to SQL classes displayed at all.

+4
source share
1 answer

Perhaps in Visual Studio Designer, select a class and in the properties you can change Access to Internal.

alt text http://img410.imageshack.us/img410/970/l2svs2008access.png

The same principles apply to the DataContext itself (just click on the β€œwhite area” of the designer) and change it to β€œProperties”.

+6
source

All Articles