Unity, LINQ to SQL, and Implicitly Injecting a Shared DataContext

Topics: General discussion
Feb 15, 2009 at 8:20 PM
I'm currently using Unity and LINQ to SQL on a project and have a need to share a LINQ to SQL DataContext between two services in the presentation layer. So far, we've managed to keep the DataContext out of the presentation layer, and we'd like to keep it out. I know I could register a DataContext in a child container explicitly, but can I somehow implicitly register a DataContext that can be shared between two services? If not, I think registering a factory method might work, but I'd love to somehow inject a shared DataContext for all services.
Feb 16, 2009 at 7:35 AM
You can post this query to the Unity Forum : http://www.codeplex.com/unity

Valiant Dudan
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com