I would like to use Castle Windsor for dependency injection for my solution consisting of the following projects:
- Mvc [ASP.NET MVC 3 Web Application]: presentation layer (depends on Business and Models)
- Business [Class Library]: business layer (depends on DataAccess and Models)
- DataAccess [Class Library]: data access layer (depends on Models)
- Models [Class Library]: model layer
In the business layer there is a class called PostService implementing IPostService that manages blog posts. The PostsController of the Mvc project depends on IPostService. However, PostService (the corresponding concrete implementation) itself depends on IPostRepository.
Where do I configure Castle Windsor to return an instance of PostRepository to resolve IPostRepository? The Mvc project doesn't know about the DataAccess project. Thus, I can't configure the component bindings in global.asax or somewhere else within Mvc.
[Update] Dependency Diagram
Now that I've found a solution (thanks again, Darin Dimitrov!) I'd like to share the current dependency diagram with you.
