Page 1 of 1

Next bug with LinQ2mySQL support

Posted: Sat 31 Jan 2009 16:40
by Zero-G.
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

Posted: Mon 02 Feb 2009 09:14
by AndreyR
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.

Posted: Mon 09 Feb 2009 11:02
by AndreyR
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 %]

Posted: Fri 13 Feb 2009 17:08
by Zero-G.
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 
	%]