skip to the main content area of this page
Patterns and Practices

 

Unity March 24 Update: Mapping of Generic Types - Injection Configuration - Performance Improvements


A new Unity release on March 24, 2008 that includes mapping of open generic types, the ability to specify injection configuration via a configuration file, and some performance improvements. This is expected to be the last release before Unity goes into production with an expected release on April 7, 2008.

 

Unity - Mapping of Generic Types

This is a pretty cool addition to Unity that allows you to register open generic types like-

 

container.RegisterType(typeof(IRepository<>), typeof(Repository<>))();

 

Which means when you resolve IRepository<Customer>:

 

container.Resolve<IRepository<Customer>>();

 

Unity will return an instance of Repository<Customer>.

 

Download the latest version of Unity from CodePlex.


Tags: DependencyInjection, IoC, Unity


Topics



 

Popular Tags



Recent Links