tags:

views:

23

answers:

1

in C#.net, Can i pass a DataContext object (created by LINQ to SQL) as a parameter of a method in another class ?

+2  A: 

You can if the project that the class is defined in references the project the datacontext object is created in. Those DataContext objects are auto-generated however and aren't necessary a good dependency to add to your other "concrete" classes. I'd just translate the data in the datacontext into a concrete business object and pass that into your class as a parameter to your method.

Achilles