title: How to scan and auto-configure profiles in AutoMapper?
body: <p>Is there any way to auto-configue Automapper to scan for all profiles in namespace/assembly? What I would like to do is to add mapping profiles to AutoMapper from given assembly filtered by given interface, something like Scan Conventions in StructureMap:</p>
  
  <pre><code>    public static void Configure()
      {
          ObjectFactory.Initialize(x =&gt;
              {
                  // Scan Assembly
                  x.Scan(
                      scanner =&gt;
                      {
                          scanner.TheCallingAssembly();
                          scanner.Convention&lt;MyCustomConvention&gt;();
                          scanner.WithDefaultConventions();
                      });
  
                  // Add Registries
                  x.AddRegistry(new SomeRegistry());
              });
  
          Debug.WriteLine(ObjectFactory.WhatDoIHave());
      }
  
  public class MyCustomConvention : IRegistrationConvention
  {
      public void Process(Type type, Registry registry)
      {
          if (!type.CanBeCastTo(typeof(IMyType)))
          {
              return;
          }
  
          string name = type.Name.Replace("SomeRubishName", String.Empty);
          registry.AddType(typeof(IMyType), type, name);            
      }
  </code></pre>
  
  <p>I've tried to use SelfConfigure but can't find any documentation on how to use it to filter out profiles:</p>
  
  <pre><code>    public static void Configure()
      {
          Mapper.Initialize(x =&gt;
                                {
                                    // My Custom profile
                                    x.AddProfile&lt;MyMappingProfile&gt;();
  
                                    // Scan Assembly
                                    x.SelfConfigure(Assembly.GetCallingAssembly());
                                });
      }
  </code></pre>
  
  <p>Another question is how can I report all maps/profiles already initialized (something like ObjectFactory.WhatDoIHave() in StructureMap)?</p>