views:

17

answers:

1

I have a LINQ to SQL datacontext that is wrapped in a static class so it can be accessed from anywhere in our web application. Our project is split into two different parts: 1 - the business layer (a class library) and 2 - the front end web forms.

When I access the datacontext from the web form part of the project I can use all of the extension methods but in the business layer I can only access some methods none of the extension methods

Access to the context is done in the same way in both instances: SqlServer.AbcDataContext

Is there a reason that the extension methods are not available?

+1  A: 

The extension methods are in a different namespace (System.Linq, if I remember correctly) so you'll need to add a using statement to the business layer files to get access to them.

The default template for a webform class already has this using statement, which is why you can access them from there.

Martin Harris
Thanks. I thought it would be something simple.
Sean