title: UnityRegistry.Scan vs. UnityContainer.RegisterTypes
body: <p>I have an application that uses Unity. In one area of the application, the code scans the assembly to register the types (auto-registration) using this code:</p>
  
  <pre><code>public class CommonRegistry : UnityRegistry
  {
      public CommonRegistry()
      {
          const StringComparison strCmp = StringComparison.InvariantCultureIgnoreCase;
  
          Register&lt;ITenantStore, TenantStore&gt;();
  
          Scan(scanner =&gt;
          {
              scanner.AssembliesInBaseDirectory(asm =&gt; asm.GetName().Name.StartsWith(@"Infrastructure", strCmp));
              scanner.ForRegistries();
          });                       
      }
  }
  </code></pre>
  
  <p>The above code uses the UnityRegistry class of the UnityConfiguration assembly.</p>
  
  <p>But in the Unity documentation, the example shows this code:</p>
  
  <p>unityContainer.RegisterTypes(AllClasses.FromLoadedAssemblies(), ...</p>
  
  <p>What is the difference between the two?</p>