LINQ is not working as intended

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Works as Designed
    • Priority: Minor - P4
    • None
    • Affects Version/s: 2.5
    • Component/s: LINQ
    • Environment:
      Windows 10, .NET 4.7.1
    • None
    • Fully Compatible
    • None
    • None
    • None
    • None
    • None
    • None

      The following code works:

      var dataCollection = Db.GetCollection<User>("User");
      var results = dataCollection.AsQueryable().Where(p => p.Id == userId);
      

      but it doesn't work if you do it like this:

      var dataCollection = Db.GetCollection<User>("User");
      var query = dataCollection.AsQueryable();
      
      query.Where(p => p.Firstname == "Tom");
      query.Where(p => p.Lastname == "Smith");
      

      it seems if its not part of the original variable, then mongo LINQ will totally ignore it

            Assignee:
            Robert Stam
            Reporter:
            Ed Lomonaco
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: