Passing an instantiated class to concrete class derived by Castle Windsor

Posted by Tr1stan on Stack Overflow See other posts from Stack Overflow or by Tr1stan
Published on 2010-05-17T19:29:41Z Indexed on 2010/05/17 19:51 UTC
Read the original article Hit count: 380

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) controller, 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.

© Stack Overflow or respective owner

Related posts about c#

Related posts about ioc