views:

238

answers:

2

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...

+2  A: 

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 :)

Rob Conery
awesome, thanks Rob. Found a fix, unfortunately haven't had time to check out git yet, still kickin' it svn style. ;) I'll email the changes to your gmail account if you wanna roll 'em in. thanks!!
Mike
Can you please post changes here so that others can use?
effkay
A: 

I have the same problem, but with types Uint32. Can you show me example, what i should add in GetSysType?