Nullable comparisons don't work in VB

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 1.6
    • Affects Version/s: 1.5
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • 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
              Reporter:
              Craig Wilson
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: