title: C# Mongodb. Project Json to strong type after grouping
body: <p>This is my query: </p>
  
  <pre><code>db.getCollection('design_ideas').aggregate( 
    { $match : {'Deals.URL': 'warm-up-with-white'}},
    { $unwind : '$Deals' },
    { $match : {'Deals.URL': 'warm-up-with-white'}},
    {$group: {_id : '$Deals.URL', Deals: {$addToSet: '$Deals'}}}
  )
  </code></pre>
  
  <p>Same query in C#: </p>
  
  <pre><code>_mongoDB.GetCollection&lt;DesignCategoryMongoModel&gt;("design_ideas")
                 .Aggregate()
                 .Match(BsonDocument.Parse("{'Deals.URL': 'warm-up-with-white'}"))
                 .Unwind("Deals")
                 .Match(BsonDocument.Parse("{'Deals.URL': 'warm-up-with-white'}"))
                 .Group(BsonDocument.Parse("{_id : '$Deals.URL', Deals: {$addToSet: '$Deals'}}"))               
                 .FirstOrDefault();
  </code></pre>
  
  <p>Result of the query is one document with such structure: </p>
  
  <pre><code>{
       _id: 'url',
        Deals: [{
                DealId: 1,
                Name: 'Name',
                Products: [...]
                ...
        }]
  }
  </code></pre>
  
  <p>I know that always I get the only one <code>Deal</code> object in the Deals result array.</p>
  
  <p>My c# class:</p>
  
  <pre><code>public class Deal
  {
      public int DealId {get; set;}
      public string Name {get; set;}
      public IEnumerable&lt;Product&gt; Products {get; set;}
  }
  </code></pre>
  
  <p>My question is how to project result <code>Json</code> to strong C# type and is exist way to get the only one Deal object (not array)?</p>