Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-2519

AsQueryable Linq Condition and BsonDocument Filter

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.7.3
    • Component/s: API
    • Environment:
      ASP.net Core / WEB API

      Hi All,

         I have one Model Class its ID element contain BsonDocument  and rest of the properties are normal BsonElement ,i would like to Get the information from the DB with normal Linq Condition and Filter inside the BsonDocument also , Please let me know how can i do that

      Eg : 
      Var Items = Collection.AsQueryable<Tclass>().Where(p=> p.FirstName="sd" && p.Id.Country=="sd").ToList()

      Model :

      [BsonElement("ID")]
      public BsonDocument Id { get; set; }-- ID Contains / Address / Place /Country etc 

      [BsonElement("FirstName")]
      public string FirstName{ get; set; }

      Thanks 
      SUJIL T

            Assignee:
            wan.bachtiar@mongodb.com Wan Bachtiar
            Reporter:
            thavidatt_sujil SUJIL
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: