DIWithUnity Sample code where is it?

May 20, 2013 at 1:23 PM
Hi all,
Download the Unity Guidance and it mentions some sample code called "DIWithUnity". Cannot seem to find anywhere. I was particularly interested in the end to end example of UnityWCF DI.

There is not mentioned in the guide how you would call the service from client.

There is only the host code.

many thanks
May 31, 2013 at 3:03 PM
The Developer's Guide Samples can now be found on the download page. it includes a WCF sample.

Randy Levy
Enterprise Library support engineer
Support How-to
May 31, 2013 at 3:44 PM
Thanks randylevy,

I installed the package Unity.Mvc3 and works fine, as I read in an article can you please confirm this is the case?
    /// ASP.Net MVC and Web.API are using two different dependency resolver infrastructure.
    /// To setup unity correctly follow the instructions below:
    /// To make Unity work with MVC controllers the ones which derives from Controller
    /// Install the Unity.Mvc3 nuget package
    /// setup the dependecy reolver with using DependencyResolver.SetResolver:
    /// DependencyResolver.SetResolver(new Unity.Mvc3.UnityDependencyResolver(container));
    /// To make Unity work with the Web.API controllers the ones which derives form ApiController
    /// install the Unity.WebAPi nuget package
    /// Set the dependency resolver with using GlobalConfiguration.Configuration:
    /// GlobalConfiguration.Configuration.DependencyResolver = new Unity.WebApi.UnityDependencyResolver(container);