title: WCF Rest with Unity
body: <p>I'm trying to use WCF REST Services and Unity (Enterprise Library 5), but can not find examples of how to implement the resolution of the services using Unity. I would like to call the registration of all interfaces and implementations for resolution in global.asax.</p>
  
  <p>I'm using the following class to register the container:</p>
  
  <pre><code>public class DependencyResolver
  {
      public static IUnityContainer Container { get; private set; }\
  
      static DependencyResolver()
      {
          Container = new UnityContainer()
              .AddNewExtension&lt;EnterpriseLibraryCoreExtension&gt;()
              .RegisterType&lt;IServiceDAO, ServiceDAO&gt;()
              .RegisterType&lt;IServiceBO, ServiceBO&gt;()
              .RegisterType&lt;IService, Service&gt;();
      }
  }
  </code></pre>
  
  <p>I searched but could not find enough examples, someone would have a code example with this solution applied?</p>
  
  <p>I found some examples, like <a href="https://stackoverflow.com/questions/2454850/how-do-i-pass-values-to-the-constructor-on-my-wcf-service/2455039#2455039">How do I pass values to the constructor on my wcf service?</a> but I want the same context for all services. I want something like this <a href="http://entlibex.codeplex.com/wikipage?title=Unity%20Service%20Behavior&amp;referringTitle=Documentation" rel="nofollow noreferrer">http://entlibex.codeplex.com/wikipage?title=Unity%20Service%20Behavior&amp;referringTitle=Documentation</a> but in my case I don't have a svc file.</p>
  
  <p>Thank you.</p>