title: Cannot reuse an 'ApiController' instance - Unity DI
body: <p>I followed <a href="https://docs.microsoft.com/en-us/aspnet/web-api/overview/advanced/dependency-injection" rel="nofollow noreferrer">this</a> tutorial to use Unity dependency injection in WebAPI.</p>
  
  <p>To avoid registering each type seperatly I used this setup</p>
  
  <pre><code>_container.RegisterTypes(
              AllClasses.FromLoadedAssemblies(),
              WithMappings.FromMatchingInterface,
              WithName.Default,
              WithLifetime.ContainerControlled);
  </code></pre>
  
  <p>This works well for the first time but since the second one I get </p>
  
  <blockquote>
    <p>"Cannot reuse an 'ApiController' instance. 'ApiController' has to be constructed per incoming message. Check your custom 'IHttpControllerActivator' and make sure that it will not manufacture the same instance."</p>
  </blockquote>
  
  <p>How do I reslove this?</p>