How to register unity convention based registration for to work on Multiple projects ?
I have these below projects created on my soution
iSample.Interface (All interfaces present here like ITest ,etc.)
iSample.EntityDB (Entity Frmework)
iSample.Business (Test class present here which implement iSample.Interface.ITest which I want to resolve through DI using Convention based registration)
iSample.PresentationMVC (MVC project)
iSample.UnityDI (Microsoft Unity DI)
Project References as below
All the projects refer to iSample.UnityDI except iSample.PresentationMVC
iSample.PresentationMVC refers to iSample.UnityDI and iSample.Interface
iSample.Business refers to iSample.Interface and iSample.EntityDB
Currently I am using below code which is not working when I am separating Unity as a separate project i.e. iSample.UnityDI
container.RegisterTypes(
AllClasses.FromAssembliesInBasePath(),
WithMappings.FromMatchingInterface,
WithName.Default,
WithLifetime.ContainerControlled);
Edited : - I am using the Composition Root but I need to resolve the Dependency by loading all the module so I am not sure how to register them using convention based registration