.net – Subsonic VB.NET problem

subsonicvb.net

When I'm using VB.NET to use subsonic, It seems to have problem marking records as Old and Clean. Whenever I query using ExecuteSingle or ExecuteTypedList, i need to manually MarkClean and MarkOld, else whenever I save it will save as a new record.

Am I the only one facing this problem ? I'm using SubSonic 2.2 btw.

Best Answer

I checked the source code of SubSonic.. and I found that the VB class generator doesn't implements the IActiveRecord. I think most likely is because VB.Net doesn't seem to support 're-implementation' of inheritance or whatever you call that...

So when I debug, I found that Utility.IsSubSonicType returns false (because the ActiveRecord class returns as IReadOnlyRecord, but IsSubSonicType checks for IActiveRecord and IRecordBase) and thus doesn't call the SetLoadState and MarkClean.

So I'm not sure if this is a bug or it is intentional. Any way to solve this?