Dependency Injection with Unity and Linq to SQL DataContexts
2008年06月06日 01:00 • 查看 27 次 • 打印本文
Here’s a little problem I ran into trying to use Unity as part of a factory for my ASP.NET MVC controllers. I was using a simple factory pattern to inject a Linq to SQL DataContext into the controller class the factory was constructing. Linq to SQL generates the data context code which leads to a few challenges when you try and consume it with Unity.
评论
发表评论