New Unity IoC Screencast - Includes Unity Tutorials on Common Tasks
by David Hayden, Microsoft MVP C#
I uploaded a brand new Unity IoC Screencast this weekend that reflects a number of the Unity API Changes as well as the ASP.NET MVC Framework Preview 2. Given that Unity should be released sooner than later, the screencast starts off with a few Unity Tutorials that show how to use the Unity API to do such things as:
- Creating Types Not In Container
- Registering and Resolving TypeMappings
- Registering and Resolving Named TypeMappings
- Singletons, LifetimeManagers, and the ContainerControlledLifetimeManager
- Registering Existing Instances
- Injecting Dependencies into Existing Instances
- Populating the UnityContainer via App.config / Web.config
- Specifying Dependencies via Injection API as opposed to Dependency Attributes
- Using Nested ( Parent-Child ) Unity Containers
In addition, I also go over how to use Unity with both ASP.NET Model-View-Presenter ( MVP ) and ASP.NET Model-View-Controller ( MVC ).
Much thanks to Chris Tavares for his help in figuring out the best way to hook up Unity with the ASP.NET MVC Framework Preview 2. Microsoft changed the IControllerFactory interface to pass a controller name as opposed to the controller type to be created, which negated the custom controller factory I used to use. Chris pointed out an alternative method and hence I have updated my two posts:
Watch the Unity IoC Screencast.
Hope it helps.
Dave