Next bug with LinQ2mySQL support

Next bug with LinQ2mySQL support

Postby Zero-G. » Sat 31 Jan 2009 16:40

Hey
So, I have a few columns in my DataBase which are allowed to be Null

I picked one of the generated code out. - This looks like as follows:
Code: Select all
  _
      Public Property cyl_li() As System.Nullable(Of Decimal)
         Get
            Return Me._cyl_li
         End Get
         Set
                If ((Me._cyl_li = Value) _
                            = False) Then
                    Me.Oncyl_liChanging(Value)
                    Me.SendPropertyChanging()
                    Me._cyl_li = Value
                    Me.SendPropertyChanged("cyl_li")
                    Me.Oncyl_liChanged()
                End If
         End Set
      End Property

The problem is, that when the code compare the value with the variable: _cyl_li then it will not come into the codeblock, because comparing NOTHING with a value has as result NOTHING and not False

Take a look
THX
Zero-G.
 
Posts: 390
Joined: Sat 09 Dec 2006 12:20

Postby AndreyR » Mon 02 Feb 2009 09:14

Thank you for the report, this problem was already found.
I will let you know as soon as it is fixed. Sorry for the inconvenience.
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Postby AndreyR » Mon 09 Feb 2009 11:02

The problem is fixed, look forward to the next build.
As a workaround, you can replace the following lines in the template file (%Program Files%\Devart\dotConnect\EntityDeveloper\Templates\LINQ\VB\property.tmpl)
Code: Select all
[%If [IsValueType Type]
  [% If ((Me._[%Name%] = value) = false) Then %]

with these lines:
Code: Select all
[%If [And [Not Nullable][IsValueType Type]]
  [% If Me._[%Name%].Equals(value) = false) Then %]
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Postby Zero-G. » Fri 13 Feb 2009 17:08

Hey
Your suggestion is not working!
The correct code is:

Code: Select all
[%If [And [Not Nullable][IsValueType Type]]
  [% If Me._[%Name%].Equals(value) = false Then
   %]
Zero-G.
 
Posts: 390
Joined: Sat 09 Dec 2006 12:20


Return to LinqConnect (LINQ to SQL support)