title: How do I filter out <>c_DisplayClass types when going through types via reflection?
body: <p>I am trying to create a unit test that makes sure all of my business classes (I call them command and query classes) can be resolved with Windsor.  I have the following unit test:</p>
  
  <pre><code>    [TestMethod]
      public void Windsor_Can_Resolve_All_Command_And_Query_Classes()
      {
          // Setup
          Assembly asm = Assembly.GetAssembly(typeof(IUnitOfWork));
          IList&lt;Type&gt; classTypes = asm.GetTypes()
                                      .Where(x =&gt; x.Namespace.StartsWith("MyApp.DomainModel.Commands") || x.Namespace.StartsWith("MyApp.DomainModel.Queries"))
                                      .Where(x =&gt; x.IsClass)
                                      .ToList();
  
          IWindsorContainer container = new WindsorContainer();
          container.Kernel.ComponentModelBuilder.AddContributor(new SingletonLifestyleEqualizer());
          container.Install(FromAssembly.Containing&lt;HomeController&gt;());
  
          // Act
          foreach (Type t in classTypes)
          {
              container.Resolve(t);
          }
      }
  </code></pre>
  
  <p>This fails with the following exception:</p>
  
  <pre><code>No component for supporting the service MyApp.DomainModel.Queries.Organizations.OrganizationByRegistrationTokenQuery+&lt;&gt;c__DisplayClass0 was found
  </code></pre>
  
  <p>I understand that <code>&lt;&gt;c__DisplayClass0</code> types are due to Linq being compiled, but how can I filter out these types without hardcoding the name in my Linq query?</p>