Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VB code setting Nullable property #322

Open
GoogleCodeExporter opened this issue Apr 24, 2015 · 1 comment
Open

VB code setting Nullable property #322

GoogleCodeExporter opened this issue Apr 24, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant