title: How implement Strategy/Facade Pattern using Unity Dependecy Injection Web API
body: <p>How tell to Unity.WebApi dependency injection framework, inject the correct class in the correct controller?</p>
  
  <p>DI Project Container </p>
  
  <pre><code>public class UnityContainerConfig
  {
  
      private static IUnityContainer _unityContainer = null;
  
      public static IUnityContainer Initialize()
      {
          if (_unityContainer == null)
          {
              _unityContainer = new Microsoft.Practices.Unity.UnityContainer()  
              .RegisterType&lt;IMyInterface, MyClass1&gt;("MyClass1")
              .RegisterType&lt;IMyInterface, MyClass2&gt;("MyClass2")
       }
  }
  </code></pre>
  
  <p>-MVC PROJECT-</p>
  
  <pre><code>public static class UnityConfig
  {
      public static void RegisterComponents()
      {            
          GlobalConfiguration.Configuration.DependencyResolver = new UnityDependencyResolver(DependencyInjection.UnityContainer.UnityContainerConfig.Initialize());
      }
  }
  </code></pre>
  
  <p>Controller 1:</p>
  
  <pre><code> private IMyInterface _myInterface
   ///MyClass1
   public XController(
           IMyInterface myInterface
          )
      {
          _myInterface = myInterface
      }
  </code></pre>
  
  <p>Controller 2:</p>
  
  <pre><code> private IMyInterface _myInterface
   ///MyClass2
   public YController(
           IMyInterface myInterface
          )
      {
          _myInterface = myInterface
      }
  </code></pre>