title: Map models in the loop
body: <p>I need to map two models when names are equal. I grab them via reflection like this:</p>
  
  <pre><code>var domainModels = Assembly.Load("Domain.Model").GetTypes();
  var dtoModels = Assembly.Load("Service.Model").GetTypes();
  </code></pre>
  
  <p>I've tried to do this in the nested loop like this:</p>
  
  <pre><code>foreach (var dto in dtoModels)
          {
  
              foreach (var domain in domainModels)
              {
                  if (domain.Name == dto.name)
                  {
                       Mapper.CreateMap&lt;domainModels.First(), dtoModels.First()&gt;()
  
                  }                            
              }
  </code></pre>
  
  <p>but I got an error:     Operator '&lt;' cannot be applied to operands of type 'method group' and 'Type' I now that I need to have a class inside &lt;>. How to achieve that? Is there better way to mapp two models whene the names match?</p>