When saving a row that has a integere primary key following exception is thrown in the VB version: 'Public member 'ChangeTypeTo' on type 'Decimal' not found.'
This happens in ActiveRecord.VB file line 3406:
Public Sub SetKeyValue(value As Object) Implements IActiveRecord.SetKeyValue
If value IsNot Nothing AndAlso value IsNot DBNull.Value Then
Dim settable = value.ChangeTypeTo(Of Integer)()
I can change the last line to:
Dim settable = CInt(value) 'value.ChangeTypeTo(Of Integer)()
This will fix the problem until I recompile the .tt files.
My question is, how can I change this in the ActiveRecord.tt file? The code in the tt file looks like this:
Dim settable = value.ChangeTypeTo(Of <#=tbl.PK.SysType#>)()
Any help is appreciated.
Thanks