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

我与影子孤独终老i 提交于 2019-12-11 22:20:22

问题


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


回答1:


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



来源:https://stackoverflow.com/questions/1283615/subsonic-object-of-type-system-uint64-cannot-be-converted-to-type-system-in

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!