Auto Discovering Types

Jun 7, 2011 at 10:20 PM

In Unity what is the best an most typical way for automatically searching through all referenced assemblies to find types to add to the container.  I know that some other DI container support this.  For example, I want to find all types that implement IRepository<> and automatically add them to the container using a specific configuration that is common for all repositories.

Thanks

Jun 8, 2011 at 2:21 AM

Hi,

I'm afraid you need to use reflection on this since Unity doesn't support this kind of functionality.

 

Noel Angelo Bolasoc
Global Technologies and Solutions
Avanade, Inc.
entlib.support@avanade.com

Jun 8, 2011 at 2:57 AM

Have a look at the automapper project on codeplex

http://automapper.codeplex.com