开发者

Passing an instantiated class to concrete class derived by Castle Windsor

I have a system that I'm using to test some new architecture. I have the following setup (In MVC2 .Net - C Sharp):

View < Controller < Service < Repository < DB

I'm using Castle Windsor as my DI (IoC) cont开发者_高级运维roller, and this is working just fine in both the Service and Repo layers. However, I'm now at a point where I would like to pass an Entity Framework (DatabaseNameEntity) to the constructor to the Service, and then to the Repo, so that I have something similar to a Unit of Work pattern per request (This feels like what I'm trying to achieve anyway) - and I'm having trouble working out how this can be done using Castle Windsor.

Am I going off on a silly tangent? Any pointers appreciated.


How would you like to pass that? From the call site? Use Typed Factory Facility for that.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜