title: Projection of mongodb subdocument and get subdocument as class in c#
body: <p>
  Hi. I have a Collection named "Level" with this class structure :<br>
  </p>
  
  <pre><code>    public class Level 
      {
        [BsonId]
        public string Id {get; set;}
        public string Name { get; set; }
        public int Number { get; set; }
        public int TotalScore { get; set; }
        public int QuestionCount { get; set; }
        public IEnumerable&lt;ConnectingQuestion&gt; ConnectingQuestions { get; set; }
      }
      public class ConnectingQuestion 
      {
        [BsonId]
        public string Id { get; set; }
        public int QuestionNumber { get; set; }        
        public string Description { get; set; }       
        public string Type { get; set; }  
        public string Title { get; set; }
      }
  </code></pre>
  
  <p>and collection structure like this :</p>
  
  <pre><code>{ 
  "_id" : "64e850f95322e01e88f131a2", 
  "Name" : "First Level", 
  "Number" : NumberInt(1), 
  "TotalScore" : NumberInt(2690), 
  "QuestionCount" : NumberInt(40), 
  "ConnectingQuestions" : [
      {
          "_id" : "5a130570738634297478fb43", 
          "QuestionNumber" : NumberInt(1), 
          "Description" : "desc", 
          "Type" : "sc", 
          "Title" : "title1", 
       },
       {
          "_id" : "5a130570738634297478fb76", 
          "QuestionNumber" : NumberInt(2), 
          "Description" : "desc", 
          "Type" : "sc", 
          "Title" : "title2", 
       },
       {
          "_id" : "5a130570738634297478fb23", 
          "QuestionNumber" : NumberInt(3), 
          "Description" : "desc", 
          "Type" : "sc", 
          "Title" : "title3", 
       }
      ]
  }
  { 
  "_id" : "59e850f95322e01e88f131c1", 
  "Name" : "Second Level", 
  "Number" : NumberInt(2), 
  "TotalScore" : NumberInt(8000), 
  "QuestionCount" : NumberInt(20), 
  "ConnectingQuestions" : [
      {
          "_id" : "5a130570738634297478fa56", 
          "QuestionNumber" : NumberInt(1), 
          "Description" : "desc", 
          "Type" : "sc", 
          "Title" : "title1", 
       },
       {
          "_id" : "5a130570738634297478fb66", 
          "QuestionNumber" : NumberInt(2), 
          "Description" : "desc", 
          "Type" : "sc", 
          "Title" : "title2", 
       },
       {
          "_id" : "5a130570738634297478fe32", 
          "QuestionNumber" : NumberInt(3), 
          "Description" : "desc", 
          "Type" : "sc", 
          "Title" : "title3", 
       }
      ]
  }
  </code></pre>
  
  <p>
  i need to write Query in c# that first select level with specified id and in selected level, select and return "ConnectingQuestion" subcollection with certain "QuestionNumber" in type of ConnectingQuestion class and not BsonDocument.
  A pseudo-query like this:</p>
  
  <pre><code> ConnectingQuestion cq = MongoDB.Levels.find(level.id == "59e850f95322e01e88f131c1" &amp;&amp; level.ConnectingQuestions.QuestionNumber == 2).Projection(level.ConnectingQuestions).SingleOrDefault();
  </code></pre>