<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>Enterprise Library 3.0</title><link>http://davidhayden.com/blog/dave/category/60.aspx</link><description>Enterprise Library 3.0</description><managingEditor>Dave Hayden</managingEditor><dc:language>en-US</dc:language><generator>.Text Version 0.95.2004.101</generator><item><dc:creator>Dave Hayden</dc:creator><title>Validation Application Block and Unity Screencast - Enterprise Library 4.0</title><link>http://davidhayden.com/blog/dave/archive/2008/05/27/ValidationApplicationBlockUnityScreencastEnterpriseLibrary4.aspx</link><pubDate>Tue, 27 May 2008 21:31:00 GMT</pubDate><guid>http://davidhayden.com/blog/dave/archive/2008/05/27/ValidationApplicationBlockUnityScreencastEnterpriseLibrary4.aspx</guid><description>PnPGuidance screencast showing how to use the Validation Application Block with Unity in Enterprise Library 4.0. Hope it helps :)&lt;img src ="http://davidhayden.com/blog/dave/aggbug/3568.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Dave Hayden</dc:creator><title>EntLib 4.0 Data Access Application Block and Unity Screencast</title><link>http://davidhayden.com/blog/dave/archive/2008/05/23/EntLib4DataAccessApplicationBlockUnityScreencast.aspx</link><pubDate>Fri, 23 May 2008 00:37:00 GMT</pubDate><guid>http://davidhayden.com/blog/dave/archive/2008/05/23/EntLib4DataAccessApplicationBlockUnityScreencast.aspx</guid><description>The first screencast on Enterprise Library 4.0, which covers using the Data Access Application Block with Unity.&lt;img src ="http://davidhayden.com/blog/dave/aggbug/3564.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Dave Hayden</dc:creator><title>Enterprise Library 4.0 Data Access Application Block ( DAAB ) and Unity IoC Tutorial - DataAccessBlockExtension</title><link>http://davidhayden.com/blog/dave/archive/2008/05/19/EnterpriseLibrary4DataAccessApplicationBlockDAABUnityIoCTutorial.aspx</link><pubDate>Mon, 19 May 2008 00:19:00 GMT</pubDate><guid>http://davidhayden.com/blog/dave/archive/2008/05/19/EnterpriseLibrary4DataAccessApplicationBlockDAABUnityIoCTutorial.aspx</guid><description>Quick tutorial on how to get the Enterprise Library 4.0 Data Access Application Block to work with Unity.&lt;img src ="http://davidhayden.com/blog/dave/aggbug/3559.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Dave Hayden</dc:creator><title>Download Enterprise Library 4.0 for Visual Studio 2008 and .NET 3.5 - Unity IoC - Enterprise Library Tutorials</title><link>http://davidhayden.com/blog/dave/archive/2008/05/16/DownloadEnterpriseLibrary4VisualStudio2008Net35UnityIoCEnterpriseLibraryTutorials.aspx</link><pubDate>Fri, 16 May 2008 23:34:00 GMT</pubDate><guid>http://davidhayden.com/blog/dave/archive/2008/05/16/DownloadEnterpriseLibrary4VisualStudio2008Net35UnityIoCEnterpriseLibraryTutorials.aspx</guid><description>Congratulations to the Enterprise Library Team for their release of Enterprise Library 4.0. A few enhancements and bug fixes in this release, but most importantly it comes with Unity IoC Integration.&lt;img src ="http://davidhayden.com/blog/dave/aggbug/3557.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Dave Hayden</dc:creator><title>Unity 1.0 Released - Patterns &amp; Practices IoC Container</title><link>http://davidhayden.com/blog/dave/archive/2008/04/04/Unity10ReleasedPatternsPracticesIoCContainer.aspx</link><pubDate>Fri, 04 Apr 2008 20:33:00 GMT</pubDate><guid>http://davidhayden.com/blog/dave/archive/2008/04/04/Unity10ReleasedPatternsPracticesIoCContainer.aspx</guid><description>&lt;H1&gt;&lt;FONT face=Verdana&gt;Unity 1.0 Released - Patterns &amp;amp; Practices IoC Container&lt;/FONT&gt;&lt;/H1&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;by &lt;/FONT&gt;&lt;A href="http://www.davidhayden.com/"&gt;&lt;FONT face=Verdana size=2&gt;David Hayden&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana size=2&gt;, &lt;/FONT&gt;&lt;A href="http://www.davidhayden.com/blog.aspx"&gt;&lt;FONT face=Verdana size=2&gt;Florida ASP.NET Developer&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;&lt;A href="http://www.pnpguidance.net/Post/Unity10ReleasedMicrosoftIoCDependencyInjection.aspx"&gt;&lt;FONT face=Verdana size=2&gt;&lt;/FONT&gt;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;A href="http://www.pnpguidance.net/Post/Unity10ReleasedMicrosoftIoCDependencyInjection.aspx"&gt;&lt;IMG alt=Unity src="http://www.davidhayden.com/photos/unity.jpg" align=right border=0&gt;&lt;/A&gt;&lt;FONT face=Verdana size=2&gt;&lt;A href="http://www.pnpguidance.net/Post/Unity10ReleasedMicrosoftIoCDependencyInjection.aspx"&gt;Microsoft Patterns &amp;amp; Practices Released Unity 1.0 today&lt;/A&gt;. Unity is an Inversion of Control ( IoC ) Container and Dependency Injection Tool from Microsoft Patterns &amp;amp; Practices that uses ObjectBuilder 2.0 as its dependency injection engine.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;You can learn more about Unity by watching the following screencasts:&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://www.pnpguidance.net/Screencast/UnityDependencyInjectionIoCScreencast.aspx"&gt;&lt;FONT face=Verdana size=2&gt;Unity Dependency Injection IoC Screencast&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana size=2&gt; &lt;/FONT&gt;
&lt;LI&gt;&lt;A href="http://www.pnpguidance.net/Screencast/UnityIoCDependencyInjectionASPNETMVCFrameworkScreencast.aspx"&gt;&lt;FONT face=Verdana size=2&gt;Unity IoC - Dependency Injection in ASP.NET MVC Framework Screencast&lt;/FONT&gt;&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;You can also&amp;nbsp;read some tutorials on using Unity:&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://www.pnpguidance.net/Post/UnityIoCASPNETMVCFrameworkDependencyInjectionControllers.aspx"&gt;&lt;FONT face=Verdana size=2&gt;Unity IoC and ASP.NET MVC Framework - Dependency Injection of Controllers&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana size=2&gt; &lt;/FONT&gt;
&lt;LI&gt;&lt;A href="http://www.pnpguidance.net/Post/UnityNestedContainersIUnityParentContainerCreateChildContainer.aspx"&gt;&lt;FONT face=Verdana size=2&gt;Unity Nested Containers - IUnityParentContainer and CreateChildContainer&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana size=2&gt; &lt;/FONT&gt;
&lt;LI&gt;&lt;A href="http://www.pnpguidance.net/Post/UnityContainerUnityConfigurationSectionAppConfigWebConfig.aspx"&gt;&lt;FONT face=Verdana size=2&gt;UnityContainer and UnityConfigurationSection - Populating Unity Container via App.config or Web.config&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana size=2&gt; &lt;/FONT&gt;
&lt;LI&gt;&lt;A href="http://www.pnpguidance.net/Post/UnityIoCDependencyInjectionASPNETModelViewPresenter.aspx"&gt;&lt;FONT face=Verdana size=2&gt;Unity IoC Dependency Injection and ASP.NET Model-View-Presenter&lt;/FONT&gt;&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://davidhayden.com/blog/dave/archive/2008/03/31/UnityIoCExamplesCompositeWPFGuidancePackagePrismCodePlex.aspx"&gt;&lt;FONT face=Verdana size=2&gt;Unity IoC Examples in Composite WPF Guidance Package ( Prism ) on CodePlex&lt;/FONT&gt;&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.codeplex.com/unity" target=_blank&gt;&lt;FONT face=Verdana size=2&gt;Download Unity&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana size=2&gt;.&lt;/FONT&gt;&lt;/P&gt;&lt;img src ="http://davidhayden.com/blog/dave/aggbug/3508.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Dave Hayden</dc:creator><title>Enterprise Library 4.0 Download of March 2008 CTP Available</title><link>http://davidhayden.com/blog/dave/archive/2008/03/31/EnterpriseLibrary40DownloadMarch2008CTPAvailable.aspx</link><pubDate>Mon, 31 Mar 2008 20:40:00 GMT</pubDate><guid>http://davidhayden.com/blog/dave/archive/2008/03/31/EnterpriseLibrary40DownloadMarch2008CTPAvailable.aspx</guid><description>&lt;H1&gt;&lt;FONT face=Verdana&gt;Enterprise Library 4.0 Download of March 2008 CTP Available&lt;/FONT&gt;&lt;/H1&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;by &lt;A href="http://www.davidhayden.com/"&gt;David Hayden&lt;/A&gt;, &lt;A href="http://www.davidhayden.com/"&gt;Florida ASP.NET Developer&lt;/A&gt;&amp;nbsp;Filed: &lt;A href="http://davidhayden.com/blog/dave/category/60.aspx?Show=All"&gt;Enterprise Library&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.pnpguidance.net/Post/EnterpriseLibrary40March2008CTPDownloadAvailable.aspx"&gt;&lt;FONT face=Verdana size=2&gt;Enterprise Library 4.0 Download is available for the March 2008 CTP&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana size=2&gt;. This is the first and possibly only CTP for &lt;/FONT&gt;&lt;A href="http://www.pnpguidance.net/Tag/EnterpriseLibrary4.aspx"&gt;&lt;FONT face=Verdana size=2&gt;Enterprise Library 4.0&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana size=2&gt;.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;It includes support for Partially Trusted Callers which is great news when you are building ASP.NET Web Applications on a shared host provider using Partial Trust. There are also apparently numerous enahancements to a number of the Enterprise Library 4.0 Application Blocks, including the Caching Application Block, Exception Handling Application Block, Logging Application Block, and Validation Application Block.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;There is no &lt;/FONT&gt;&lt;A href="http://www.pnpguidance.net/Category/Unity.aspx"&gt;&lt;FONT face=Verdana size=2&gt;Unity IoC&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana size=2&gt; Support in the March CTP. You will be able to use Unity to configure the application blocks&amp;nbsp;in Enterprise Library 4.0 when it is officially released.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.codeplex.com/entlib" target=_blank&gt;&lt;FONT face=Verdana size=2&gt;Go to the CodePlex Site&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;img src ="http://davidhayden.com/blog/dave/aggbug/3506.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Dave Hayden</dc:creator><title>Unity Dependency Injection and Open Generic Types</title><link>http://davidhayden.com/blog/dave/archive/2008/03/25/UnityDependencyInjectionOpenGenericTypes.aspx</link><pubDate>Tue, 25 Mar 2008 18:27:00 GMT</pubDate><guid>http://davidhayden.com/blog/dave/archive/2008/03/25/UnityDependencyInjectionOpenGenericTypes.aspx</guid><description>&lt;H1&gt;&lt;FONT face=Verdana&gt;Unity Dependency Injection and Open Generic Types&lt;/FONT&gt;&lt;/H1&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Author: &lt;A href="http://www.davidhayden.com/"&gt;David Hayden&lt;/A&gt;, &lt;A href="http://www.davidhayden.com/"&gt;Florida .NET Developer&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;I mentioned on &lt;/FONT&gt;&lt;A href="http://www.pnpguidance.net/"&gt;&lt;FONT face=Verdana size=2&gt;PnPGuidance&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana size=2&gt; that there is a new drop of &lt;/FONT&gt;&lt;A href="http://www.pnpguidance.net/Category/Unity.aspx"&gt;&lt;FONT face=Verdana size=2&gt;Unity&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana size=2&gt;:&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://www.pnpguidance.net/Post/UnityUpdateMappingGenericTypesInjectionConfigurationPerformanceImprovements.aspx"&gt;&lt;FONT face=Verdana size=2&gt;Unity March 24 Update: Mapping of Generic Types - Injection Configuration - Performance Improvements&lt;/FONT&gt;&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;For those of you unfamiliar with Unity, the Unity Application Block (Unity) is a lightweight extensible &lt;A href="http://www.pnpguidance.net/Tag/DependencyInjection.aspx"&gt;dependency injection&lt;/A&gt; container with support for constructor, property, and method call injection from Microsoft Patterns &amp;amp; Practices.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;One of the new features in this recent drop of Unity is the support for open Generic Types. Hence, I can register a type of &lt;STRONG&gt;IRepository&lt;T&gt;&lt;/STRONG&gt; that maps to &lt;STRONG&gt;Respository&lt;T&gt;&lt;/STRONG&gt; like this:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #000000"&gt;&lt;FONT color=#0000ff&gt;IUnityContainer&lt;/FONT&gt; container &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;FONT color=#0000ff&gt;UnityContainer&lt;/FONT&gt;();
container.RegisterType(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;typeof&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(&lt;FONT color=#0000ff&gt;IRepository&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;), &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;typeof&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(&lt;FONT color=#0000ff&gt;Repository&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;));&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;and then resolve a type of say IRepository&lt;CUSTOMER&gt; as such from the UnityContainer:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #000000"&gt;&lt;FONT color=#0000ff&gt;IRepository&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&lt;FONT color=#0000ff&gt;Customer&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; customerRepository &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;
    container.Resolve&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&lt;FONT color=#0000ff&gt;IRepository&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&lt;FONT color=#0000ff&gt;Customer&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;();&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;For those of you using &lt;/FONT&gt;&lt;A href="http://www.pnpguidance.net/Tag/CastleWindsor.aspx"&gt;&lt;FONT face=Verdana size=2&gt;Castle Windsor&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana size=2&gt;, you can of course do the same thing.&amp;nbsp;One can register the same types in a &lt;STRONG&gt;WindsorContainer&lt;/STRONG&gt;:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #000000"&gt;&lt;FONT color=#0000ff&gt;IWindsorContainer&lt;/FONT&gt; container &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;FONT color=#0000ff&gt;WindsorContainer&lt;/FONT&gt;();
container.AddComponent(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;Repository&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;,&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;typeof&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(&lt;FONT color=#0000ff&gt;IRepository&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;),&lt;BR&gt;                                      &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;typeof&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(&lt;FONT color=#0000ff&gt;Repository&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;));&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;and then resolve a type of IRepository&lt;CUSTOMER&gt; from the WindsorContainer via&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #000000"&gt;&lt;FONT color=#0000ff&gt;IRepository&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&lt;FONT color=#0000ff&gt;Customer&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; customerRepository &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;
    container.Resolve&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&lt;FONT color=#0000ff&gt;IRepository&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&lt;FONT color=#0000ff&gt;Customer&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;();&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;For more information on Unity, you can watch my &lt;/FONT&gt;&lt;A href="http://www.pnpguidance.net/Screencast/UnityDependencyInjectionIoCScreencast.aspx"&gt;&lt;FONT face=Verdana size=2&gt;Unity IoC Screencast&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana size=2&gt;.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Hope this helps.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Dave&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;News Feed: &lt;/FONT&gt;&lt;A href="http://www.davidhayden.com/"&gt;&lt;FONT face=Verdana size=2&gt;http://www.davidhayden.com/&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;img src ="http://davidhayden.com/blog/dave/aggbug/3502.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Dave Hayden</dc:creator><title>Unity and Enterprise Library 4.0 and Prism ... OH MY!</title><link>http://davidhayden.com/blog/dave/archive/2008/02/27/UnityEnterpriseLibrary4PrismOHMY.aspx</link><pubDate>Wed, 27 Feb 2008 22:44:00 GMT</pubDate><guid>http://davidhayden.com/blog/dave/archive/2008/02/27/UnityEnterpriseLibrary4PrismOHMY.aspx</guid><description>&lt;H1&gt;&lt;FONT face=Verdana&gt;Unity and Enterprise Library 4.0 and Prism ... OH MY!&lt;/FONT&gt;&lt;/H1&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;by &lt;A href="http://www.davidhayden.com/"&gt;David Hayden&lt;/A&gt;, &lt;A href="http://www.davidhayden.com/"&gt;Florida ASP.NET Developer&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2&gt;&lt;FONT face=Verdana&gt;Unity and Enterprise Library 4.0&lt;/FONT&gt;&lt;/H2&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/agile/archive/2008/02/27/entlib-unity-roadmap.aspx" target=_blank&gt;&lt;FONT face=Verdana size=2&gt;Grigori just announced&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana size=2&gt; the &lt;/FONT&gt;&lt;A href="http://www.pnpguidance.net/Post/UnityEnterpriseLibrary4ReleasePlans.aspx"&gt;&lt;FONT face=Verdana size=2&gt;release plans for Unity 1.0 and Enterprise Library 4.0&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana size=2&gt;.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;The big day is March 15th, when Unity will apparently be released as 1.0 and we will see the first Enterprise Library 4.0 CTP.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Then by May 1 we will see the release of &lt;/FONT&gt;&lt;A href="http://www.pnpguidance.net/Tag/EnterpriseLibrary4.aspx"&gt;&lt;FONT face=Verdana size=2&gt;Enterprise Libary 4.0&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana size=2&gt; with full Unity Integration.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Boy is that quick! Agile does work :)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2&gt;&lt;FONT face=Verdana&gt;Prism on CodePlex&lt;/FONT&gt;&lt;/H2&gt;
&lt;P&gt;&lt;A href="http://www.pnpguidance.net/Category/Prism.aspx"&gt;&lt;FONT face=Verdana size=2&gt;Prism&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana size=2&gt; is a set of assets for developing &lt;STRONG&gt;Composite WPF applications&lt;/STRONG&gt;. Prism includes a reference implementation, reusable library code and pattern guidance. It is being created by the Microsoft Patterns &amp;amp; Practices Team and Prism now has a &lt;/FONT&gt;&lt;A href="http://www.codeplex.com/prism" target=_blank&gt;&lt;FONT face=Verdana size=2&gt;home on CodePlex&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana size=2&gt; with some source code spikes.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;News Feed: &lt;A href="http://www.davidhayden.com/"&gt;http://www.davidhayden.com/&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img src ="http://davidhayden.com/blog/dave/aggbug/3476.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Dave Hayden</dc:creator><title>Simple Web Application Block Gets Unity Dependency Injection Support - Abstractions Are Good!</title><link>http://davidhayden.com/blog/dave/archive/2008/02/15/SimpleWebApplicationBlockGetsUnityDependencyInjectionSupportAbstractionsAreGood.aspx</link><pubDate>Fri, 15 Feb 2008 12:41:00 GMT</pubDate><guid>http://davidhayden.com/blog/dave/archive/2008/02/15/SimpleWebApplicationBlockGetsUnityDependencyInjectionSupportAbstractionsAreGood.aspx</guid><description>&lt;H1&gt;&lt;FONT face=Verdana&gt;Simple Web Application Block Gets Unity Dependency Injection Support&lt;/FONT&gt;&lt;/H1&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;by &lt;A href="http://www.davidhayden.com/"&gt;David Hayden&lt;/A&gt;, &lt;A href="http://www.davidhayden.com/"&gt;Florida ASP.NET Developer&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;So with all this talk about the &lt;/FONT&gt;&lt;A href="http://www.pnpguidance.net/Tag/Unity.aspx"&gt;&lt;FONT face=Verdana size=2&gt;Unity Dependency Injection Container&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana size=2&gt; you are probably wondering if&amp;nbsp;Unity will be supported in the next version of the &lt;/FONT&gt;&lt;A href="http://www.pnpguidance.net/Category/WebClientSoftwareFactory.aspx"&gt;&lt;FONT face=Verdana size=2&gt;Web Client Software Factory&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana size=2&gt;, assuming there is a next version. Okay, my mistake, first you are probably wondering when the Web Client Guidance Bundle will work in Visual Studio 2008, and then you are wondering about Unity Support :)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Alright, I am teasing I know, but the truth is that 3rd party dependencies stink when developing applications. They are inevitable, but they stink. And one of my concerns&amp;nbsp;is being too dependent on 3rd party libraries, like the Composite Web Application Block, Enterprise Library, and ObjectBuilder.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;One of the first things I did when the &lt;/FONT&gt;&lt;A href="http://www.pnpguidance.net/Tag/CompositeWebApplicationBlock.aspx"&gt;&lt;FONT face=Verdana size=2&gt;Composite Web Application Block&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana size=2&gt; came out is to create my own version, the &lt;STRONG&gt;Simple Web Application Block&lt;/STRONG&gt;. This is the Composite Web Application Block without dependencies on &lt;/FONT&gt;&lt;A href="http://www.pnpguidance.net/Category/EnterpriseLibrary.aspx"&gt;&lt;FONT face=Verdana size=2&gt;Enterprise Library&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana size=2&gt; and &lt;/FONT&gt;&lt;A href="http://www.pnpguidance.net/Tag/ObjectBuilder.aspx"&gt;&lt;FONT face=Verdana size=2&gt;ObjectBuilder&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana size=2&gt;. I&amp;nbsp;replaced ObjectBuilder with my favorite IoC, &lt;/FONT&gt;&lt;A href="http://www.pnpguidance.net/Tag/CastleWindsor.aspx"&gt;&lt;FONT face=Verdana size=2&gt;Castle Windsor&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana size=2&gt;, and added StructureMap support as well to make sure I indeed had the ability to switch out IoC Containers.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;I have a few posts here about the Simple Web Application Block:&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://davidhayden.com/blog/dave/archive/2007/06/17/CompositeWebApplicationBlockObjectBuilderEnterpriseLibraryBigSmile.aspx"&gt;&lt;FONT face=Verdana size=2&gt;Composite Web Application Block - ObjectBuilder - Enterprise Library = Big Smile&lt;/FONT&gt;&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://davidhayden.com/blog/dave/archive/2007/07/04/SimpleWebApplicationBlockStructureMapWindsorDependencyInjection.aspx"&gt;&lt;FONT face=Verdana size=2&gt;Simple Web Application Block Gets StructureMap and Windsor Dependency Injection Integration&lt;/FONT&gt;&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;So you can probably guess what has been on my mind lately. Let's add Unity Support! All I need to do is create a simple adapter for Unity and all should be fine. About 1 hour later Unity now works with the Simple Web Application Block. No waiting!&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P align=center&gt;&lt;FONT face=Verdana size=2&gt;&lt;IMG alt="Unity IoC" src="http://www.davidhayden.com/photos/UnityDependencyInjectionContainer.jpg"&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Now just so you know, this wasn't all about playing ( only 90% ). I have a client right now where we are using the Simple Web Application Block and they wanted to make sure I could move to Unity when it comes out. Of course, we can...&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2&gt;&lt;FONT face=Verdana&gt;Unity Tutorials&lt;/FONT&gt;&lt;/H2&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://davidhayden.com/blog/dave/archive/2008/02/14/ASPNETMVCFrameworkUnityDependencyInjectionContainerPartII.aspx"&gt;&lt;FONT face=Verdana color=#0000ff size=2&gt;ASP.NET MVC Framework and Unity Dependency Injection Container Part II&lt;/FONT&gt;&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://davidhayden.com/blog/dave/archive/2008/02/13/UnityDependencyInjectionContainerASPNETMVCFramework.aspx"&gt;&lt;FONT face=Verdana color=#0000ff size=2&gt;Unity Dependency Injection Container and ASP.NET MVC Framework&lt;/FONT&gt;&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://davidhayden.com/blog/dave/archive/2008/02/13/UnityDependencyInjectionContainerReleasedCodePlexFeb2008CTP.aspx"&gt;&lt;FONT face=Verdana color=#0000ff size=2&gt;Unity Dependency Injection Container Released on CodePlex - Feb 2008 CTP&lt;/FONT&gt;&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Author: &lt;/FONT&gt;&lt;A href="http://www.davidhayden.com/"&gt;&lt;FONT face=Verdana size=2&gt;David Hayden&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana size=2&gt;, &lt;/FONT&gt;&lt;A href="http://www.davidhayden.com/"&gt;&lt;FONT face=Verdana size=2&gt;Florida&amp;nbsp;Web Developer&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img src ="http://davidhayden.com/blog/dave/aggbug/3462.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Dave Hayden</dc:creator><title>ASP.NET MVC Framework and Unity Dependency Injection Container Part II</title><link>http://davidhayden.com/blog/dave/archive/2008/02/14/ASPNETMVCFrameworkUnityDependencyInjectionContainerPartII.aspx</link><pubDate>Thu, 14 Feb 2008 10:34:00 GMT</pubDate><guid>http://davidhayden.com/blog/dave/archive/2008/02/14/ASPNETMVCFrameworkUnityDependencyInjectionContainerPartII.aspx</guid><description>&lt;H1&gt;&lt;FONT face=Verdana&gt;ASP.NET MVC Framework and Unity Dependency Injection Container Part II&lt;/FONT&gt;&lt;/H1&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;by &lt;A href="http://www.davidhayden.com/"&gt;David Hayden&lt;/A&gt;, &lt;A href="http://www.davidhayden.com/"&gt;Microsoft MVP C#&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&lt;FONT face=Verdana&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&lt;FONT face=Verdana&gt;&lt;STRONG&gt;Update 3/7/2008:&lt;/STRONG&gt; &lt;A href="http://www.pnpguidance.net/Post/UnityIoCASPNETMVCFrameworkDependencyInjectionControllers.aspx"&gt;Added Unity IoC and ASP.NET MVC Framework - Dependency Injection of Controllers&lt;/A&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&lt;FONT face=Verdana&gt;&lt;STRONG&gt;Update 2/19/2008:&lt;/STRONG&gt; Added &lt;/FONT&gt;&lt;/FONT&gt;&lt;A href="http://www.pnpguidance.net/Post/UnityIoCDependencyInjectionASPNETModelViewPresenter.aspx"&gt;&lt;FONT face=Verdana size=2&gt;Unity IoC Dependency Injection and ASP.NET Model-View-Presenter&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;&lt;STRONG&gt;Update 2/22/2008:&lt;/STRONG&gt; &lt;A href="http://www.pnpguidance.net/Screencast/UnityDependencyInjectionIoCScreencast.aspx"&gt;Added Unity Dependency Injection IoC Screencast&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;I received a few emails on showing more detail on how I am using the &lt;A href="http://www.pnpguidance.net/Category/ASPNETMVCFramework.aspx"&gt;ASP.NET MVC Framework&lt;/A&gt; with the &lt;A href="http://www.pnpguidance.net/Tag/Unity.aspx"&gt;Unity Dependency Injection Container&lt;/A&gt;. I am still deciding the best way to integrate the various IoC Containers with the ASP.NET MVC Framework, but this time I used the same approach as the Windsor Example in MVCContrib.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;The&amp;nbsp;HttpApplication&amp;nbsp;Class&amp;nbsp;is responsible for holding the &lt;STRONG&gt;Unity Container&lt;/STRONG&gt; and providing access to it using an &lt;STRONG&gt;IContainerAccessor&lt;/STRONG&gt; Interface:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;class&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; Global : HttpApplication, &lt;FONT color=#ff0000&gt;IContainerAccessor&lt;/FONT&gt;
{
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;private&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;static&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;FONT color=#ff0000&gt;UnityContainer&lt;/FONT&gt; _container;

    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;static&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;FONT color=#ff0000&gt;IUnityContainer&lt;/FONT&gt; Container
    {
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;get&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; { &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; _container; }
    }

    &lt;FONT color=#ff0000&gt;IUnityContainer&lt;/FONT&gt; IContainerAccessor.Container
    {
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;get&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; { &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; Container; }
    }

    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;protected&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; Application_Start(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;object&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; sender, EventArgs e)
    {
        InitializeContainer();
        ControllerBuilder.Current.
            SetDefaultControllerFactory(&lt;BR&gt;                    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;typeof&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(&lt;FONT color=#ff0000&gt;CustomControllerFactory&lt;/FONT&gt;));
    }

    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;private&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; InitializeContainer()
    {
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; (_container &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;==&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;)
            _container &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; UnityContainer();
            
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;//&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; For Sample Only...&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;        _container.RegisterType&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;INewsService, NewsService&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;();
    }
}&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;As mentioned in the previous post, &lt;/FONT&gt;&lt;A id=viewpost.ascx_TitleUrl href="/blog/dave/archive/2008/02/13/UnityDependencyInjectionContainerASPNETMVCFramework.aspx"&gt;&lt;FONT face=Verdana color=#0000ff size=2&gt;Unity Dependency Injection Container and ASP.NET MVC Framework&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana size=2&gt;, I am not adding any Controller Classes to the Unity Container. You don't need to with Unity. It will create classes even if they are not in the container.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;I am specifying my custom IControllerFactory, &lt;STRONG&gt;CustomControllerFactory&lt;/STRONG&gt;, and I am registering the &lt;STRONG&gt;NewsService&lt;/STRONG&gt; that will be injected into my &lt;STRONG&gt;HomeController&lt;/STRONG&gt;.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;As mentioned in the previous post, my CustomControllerFactory is as follows:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;class&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; CustomControllerFactory : IControllerFactory
{
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; IController CreateController
            (RequestContext context, Type controllerType)
    {
        IContainerAccessor containerAccessor &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;
            context.HttpContext.ApplicationInstance&lt;BR&gt;                 &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;as&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; IContainerAccessor;

        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; containerAccessor.Container.Resolve(controllerType)
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;as&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; IController;
    }
}&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;It may look a little confusing looking at it like this, because&amp;nbsp;I am accessing the UnityContainer through a &lt;STRONG&gt;IContainerAccessor Interface&lt;/STRONG&gt; and the &lt;STRONG&gt;Container Property&lt;/STRONG&gt; on that interface. All I am doing is using the following method on the UnityContainer API:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face=Verdana size=2&gt;UnityContainer.Resolve(Type t)&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;that will create the &lt;STRONG&gt;HomeController&lt;/STRONG&gt; Class and add any dependencies to it.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Using the &lt;STRONG&gt;Property Setter Injection Mechanism&lt;/STRONG&gt; mentioned in the previous post, since the &lt;STRONG&gt;HomeController&lt;/STRONG&gt; has a &lt;STRONG&gt;[Dependency]&lt;/STRONG&gt; Attribute on the &lt;STRONG&gt;NewsService&lt;/STRONG&gt; Property:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;class&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; HomeController : Controller
{
    [Dependency]
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; INewsService NewsService { &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;get&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;set&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;; }

    [ControllerAction]
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; Index()
    {
        List&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;News&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; currentNews &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; NewsService.GetNews();
        RenderView(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;Index&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;, currentNews);
    }
}&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Unity will inject the NewsService we registered before into the HomeController.&amp;nbsp;As mentioned&amp;nbsp;above, we registered the NewsService in the InitializeContainer Method just for this sample -&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #0000ff"&gt;private&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; InitializeContainer()
{
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; (_container &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;==&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;)
        _container &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;FONT color=#0000ff&gt;UnityContainer&lt;/FONT&gt;();
        
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;//&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; For Sample Only...&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    _container.RegisterType&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&lt;FONT color=#0000ff&gt;INewsService&lt;/FONT&gt;, &lt;FONT color=#0000ff&gt;NewsService&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;();
}
&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Note that if you wanted to register the &lt;STRONG&gt;NewsService&lt;/STRONG&gt; as a &lt;STRONG&gt;Singleton&lt;/STRONG&gt;, you could register it as follows:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #000000"&gt;_container
    .RegisterType&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&lt;FONT color=#0000ff&gt;INewsService&lt;/FONT&gt;, &lt;FONT color=#0000ff&gt;NewsService&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;gt;&lt;BR&gt;       (new &lt;FONT color=#0000ff&gt;ContainerControlledLifetimeManager&lt;/FONT&gt;()&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;);&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;I hope that clarifies how I used Unity with the ASP.NET MVC Framework. This is just one way that I modeled after the Windsor Example in the MVCContrib.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2&gt;&lt;FONT face=Verdana&gt;Recent ASP.NET MVC Tutorials:&lt;/FONT&gt;&lt;/H2&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://davidhayden.com/blog/dave/archive/2008/02/13/UnityDependencyInjectionContainerASPNETMVCFramework.aspx"&gt;&lt;FONT face=Verdana color=#0000ff&gt;Unity Dependency Injection Container and ASP.NET MVC Framework&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana&gt; &lt;/FONT&gt;
&lt;LI&gt;&lt;A href="http://davidhayden.com/blog/dave/archive/2008/02/12/ASPNETMVCFrameworkNextCTPReleasedMix08Conference.aspx"&gt;&lt;FONT face=Verdana color=#0000ff&gt;ASP.NET MVC Framework - Next CTP To Be Released At Mix 08 Conference&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana&gt; &lt;/FONT&gt;
&lt;LI&gt;&lt;A href="http://davidhayden.com/blog/dave/archive/2008/02/08/ASPNETMVCFrameworkFormsAuthenticationMVCToolkitMembershipControllerBase.aspx"&gt;&lt;FONT face=Verdana&gt;ASP.NET MVC Framework: Forms Authentication MVCToolkit and MembershipControllerBase&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana&gt; &lt;/FONT&gt;
&lt;LI&gt;&lt;A href="http://davidhayden.com/blog/dave/archive/2008/02/06/ASPNETMVCFrameworkAJAXjQueryJavaScriptSerializerLINQ.aspx"&gt;&lt;FONT face=Verdana color=#0000ff&gt;ASP.NET MVC Framework and AJAX Using jQuery, JavaScriptSerializer and LINQ&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana&gt; &lt;/FONT&gt;
&lt;LI&gt;&lt;A href="http://davidhayden.com/blog/dave/archive/2008/02/06/ASPNETMVCFrameworkSessionStateStateValueWCSF.aspx"&gt;&lt;FONT face=Verdana color=#0000ff&gt;ASP.NET MVC Framework and Session State via StateValue from WCSF&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana&gt; &lt;/FONT&gt;
&lt;LI&gt;&lt;A href="http://www.pnpguidance.net/Post/ASPNETMVCFrameworkCompositeWebApplicationBlockCWAB.aspx"&gt;&lt;FONT face=Verdana&gt;ASP.NET MVC Framework and Composite Web Application Block ( CWAB )&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana&gt; &lt;/FONT&gt;
&lt;LI&gt;&lt;A href="http://www.pnpguidance.net/Screencast/DayOfPatternsPracticesScreencastWCSFAJAXDynamicDataMVCFramework.aspx"&gt;&lt;FONT face=Verdana&gt;Day Of Patterns &amp;amp; Practices Screencast - WCSF AJAX DynamicData ASP.NET MVC Framework&lt;/FONT&gt;&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Author:&amp;nbsp;&lt;A href="http://www.davidhayden.com/"&gt;David Hayden&lt;/A&gt;, &lt;A href="http://www.davidhayden.com/"&gt;Microsoft MVP C#&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Site: &lt;A href="http://www.davidhayden.com/"&gt;http://www.davidhayden.com/&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;img src ="http://davidhayden.com/blog/dave/aggbug/3460.aspx" width = "1" height = "1" /&gt;</description></item></channel></rss>