title: Auto-register all interfaces with Unity
body: <p>Using Unity, I'd like to automatically register all interface/class combinations in an assembly based on the following convention:</p>
  
  <pre><code>INameOfObject &gt; NameOfObject
  </code></pre>
  
  <p>StructureMap does that when the default conventions are enabled.</p>
  
  <p>I wrote the following method for it:</p>
  
  <pre><code>private static IUnityContainer RegisterITypesOf(this IUnityContainer container, string assemblyName)
  {
    Assembly.Load(assemblyName)
      .GetTypes()
      .Where(t =&gt; t.GetInterfaces().Any(i =&gt; i.Name == "I" + t.Name))
      .ForEach(t =&gt; container.RegisterType(t.GetInterface("I" + t.Name, false), t));
    return container;
  }
  </code></pre>
  
  <p>My question is:</p>
  
  <ul>
  <li>is there a built-in function that does the same?</li>
  <li>if not, can my code be improved performance wise?</li>
  </ul>