google-code-export / dblinq2007

Automatically exported from code.google.com/p/dblinq2007
Other
0 stars 0 forks source link

VB code setting Nullable property #322

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Generate a .VB DataContext file with a Sqlite database
2.Create an entity of any class, and set one of its numeric property to 0

What is the expected output? What do you see instead?
I expect for the property to be set properly.  Instead, the private property 
value remains Nothing.  

What version of the product are you using? On what operating system?

Please provide any additional information below.

Here's an example : 

     <Column(Storage:="_insertionDate", Name:="insertionDate", DbType:="INTEGER", AutoSync:=AutoSync.Never), _
     DebuggerNonUserCode()> _
    Public Property InsertionDate() As System.Nullable(Of Integer)
        Get
            Return Me._insertionDate
        End Get
        Set(value As System.Nullable(Of Integer))
            If (_insertionDate <> value) Then
                Me.OnInsertionDateChanging(value)
                Me._insertionDate = value
                Me.OnInsertionDateChanged()
            End If
        End Set
    End Property
In this example, the value i'm trying to set is zero.  The problem is in the 
test if (_insertionDate <> value) Then.
Instead of returning True, this test compares Nothing (the current value of the 
private field) with value (0).  This test returns False, and the propery is 
never set.

Original issue reported on code.google.com by igelineau@gmail.com on 21 Sep 2011 at 3:01

GoogleCodeExporter commented 9 years ago
I just noticed that a similar issue have already been posted : Issue 249. Sorry 
about that.  Please discard this one.

Original comment by igelineau@gmail.com on 22 Sep 2011 at 8:54