StructureMap and Project Dependency

119 Views Asked by At

Suppose I have the following structure in my C# solution:

ServiceProject
-- IBusinessLogic.cs
-- Service.cs

BusinessLogicProject
-- IRepository.cs
-- BusinessLogic.cs

RepositoryProject
-- Repository.cs

In this case, I have BusinessLogicProject references ServiceProject (because BusinessLogic implements IBusinessLogic) and RepositoryProject references BusinessLogic (for a similar reason).

Suppose that I want to add StructureMap and use IoC container to register types and classes. It appears to me that this container will depend on interfaces--and hence should reference those projects, and it appears that all the projects need to reference this container--hence every project will depend on the container. How can I change this structure without introducing circular dependency?

0

There are 0 best solutions below