I have a solution :
Business
have a reference toBusiness.Interfaces
,DataAccess.Interfaces
andFactory
(for resolveIDataAccess
inDataAccess.Interfaces
)MainProject
have a reference toBusiness.Interfaces
andFactory
(for resolveIBusiness
inBusiness.Interfaces
)
My factory project use Unity
for resolve dependencies. This project must have a reference to all others project except MainProject
to access to constructors of concrete class and do mapping between class and interfaces.
But I don't add a reference to Business
in Factory
project because Visual Studio says to me :
A reference to Business could not be added. Adding this project as a reference would cause a circular dependency
How to resolve this ?