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

Nullable comparisons don't work in VB

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.6
    • Affects Version/s: 1.5
    • Component/s: None
    • Labels:
      None

      http://stackoverflow.com/questions/11705522/query-mongodb-using-c-sharp-nullable-types

      Imports MongoDB.Bson
      Imports MongoDB.Driver
      Imports MongoDB.Driver.Linq
      
      Module Module1
          Public Class Test
              Public Id As ObjectId
      
              Public MyNullableInt As Nullable(Of Integer)
          End Class
      
          Sub Main()
              Dim server = MongoServer.Create()
              Dim db = server.GetDatabase("test")
              Dim col = db.GetCollection(Of Test)("foos")
              col.Drop()
      
      
              Dim query = col.AsQueryable.Where(Function(p) p.MyNullableInt = 3)
      
      
              Dim list = query.ToList()
      
      
          End Sub
      
      End Module
      

            Assignee:
            craig.wilson@mongodb.com Craig Wilson
            Reporter:
            craig.wilson@mongodb.com Craig Wilson
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: