Microsoft Unity 2.0 Released


Microsoft's dependency injection framework Unity Application Block (Unity) has reached version 2.0. The release available on Codeplex at http://unity.codeplex.com/

Unity 2.0 

 UnityContainer Fluent Interface

Unity 2.0 provides a fluent interface for type configuration. Now you can call all the methods in a single statement, as shown in the following code.

 

IUnityContainer container = new UnityContainer()

.RegisterType<IFormsAuthentication, FormsAuthenticationService>()

.RegisterType<IMembershipService, AccountMembershipService>()

.RegisterInstance<MembershipProvider>(Membership.Provider)

.RegisterType<IDinnerRepository, DinnerRepository>();  

 

No Comments