title: Projecting a GroupBy with multiple keys errors with Missing map from IGrouping`2 to ModelName. Create using Mapper.CreateMap<IGrouping`2, ModelName>
body: <p>I'm getting the following error when trying to do a projection of a grouped query, that is grouped by two properties, using Automapper</p>
  
  <blockquote>
    <p>Missing map from IGrouping`2 to PlayerWarScore. Create using Mapper.CreateMap&lt;IGrouping`2, PlayerWarScore></p>
  </blockquote>
  
  <p>I'm currently trying something like this, which works fine if <code>PlayerWar</code> is an entity property of <code>Score</code></p>
  
  <pre><code>Mapper.CreateMap&lt;IGrouping&lt;PlayerWar, Score&gt;, PlayerWarScore&gt;
      .ForMember(model =&gt; model.PlayerName, model =&gt; model.MapFrom(grouping =&gt; grouping.Key.Player.Name))
      .ForMember(model =&gt; model.WarName, model =&gt; model.MapFrom(grouping =&gt; grouping.Key.War.Name)),
      .ForMember(model =&gt; model.Score, model =&gt; model.MapFrom(grouping =&gt; grouping.Sum(score =&gt; score.Score));
  </code></pre>
  
  <p>But when <code>PlayerWar</code> is not an entity, but a model created just to hold a combined key made of two entities as below, then I get the error    </p>
  
  <pre><code>public class PlayerWar
  {
      public Player Player { get; set; }
      public War War { get; set; }
  }
  </code></pre>
  
  <p>As an example, what I'm trying to achieve is, given the following EF6 entities.</p>
  
  <pre><code>public class Score
  {
      public Player Player { get; set; }
      public Battle Battle { get; set; }
      public int Score { get; set; }
  }
  
  public class Player
  {
      public string Name { get; set; }
  }
  
  public class Battle
  {
      public string Name { get; set; }
      public War War { get; set; }
  }
  
  public class War
  {
      public string Name { get; set; }
  }
  </code></pre>
  
  <p>and another model that I wish to project them to</p>
  
  <pre><code>public class PlayerWarScore
  {
      public string PlayerName { get; set; }
      public string WarName { get; set; }
      public int Score { get; set; }
  }
  </code></pre>
  
  <p>How would I achieve the following query using Automapper's <code>Project().To&lt;PlayerWarScore&gt;()</code>?</p>
  
  <pre><code>context.Scores
      .GroupBy(score =&gt; new {score.Player, score.Battle.War})
      .Select(grouping =&gt; new PlayerWarScore {
          PlayerName = grouping.Key.Player.Name,
          WarName = grouping.Key.War.Name,
          Score = grouping.Sum(score =&gt; score.Score)
      })
      .ToList()
  </code></pre>
  
  <p>I get the feeling I'm approaching it the wrong way or missing an obvious Linq feature that would make it simple. I've tried including mappings for the entities to the combined key model and other shots in the dark, but so far wihtout any luck.</p>