Subsonic : Object of type ‘System.UInt64’ cannot be converted to type ‘System.Int64’

subsonicsubsonic3

I just hooked up Subsonic to MySql for the first time. Everything seems to be cool except a simple:

wp_1_post.All().ToList();

throws:

Object of type 'System.UInt64' cannot be converted to type 'System.Int64'.

It looks like the ID column in the wp_1_posts table is an unsigned bigint, just not sure what to do about it…

Best Answer

In MySQL.tt there is a check (GetSysType) which decides which type goes to which db type. At the moment we don't have a way to sense if something is unsigned (cause I don't know how) but what you would need to do is use "ulong" for unsigned bigint.

If you're up for helping us - it would rock. It would simply be writing some code that pulls whether a column is unsigned from the schema call in MySQL.tt. I don't know how to do it and I'm really slammed trying to find another job :)

Related Topic