亚音速:“System.UInt64"类型的对象无法转换为“System.Int64"类型 [英] Subsonic : Object of type 'System.UInt64' cannot be converted to type 'System.Int64'

查看:31
本文介绍了亚音速:“System.UInt64"类型的对象无法转换为“System.Int64"类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我第一次将 Subsonic 连接到 MySql.除了简单之外,一切似乎都很酷:

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

wp_1_post.All().ToList();

wp_1_post.All().ToList();

抛出:

System.UInt64"类型的对象无法转换为System.Int64"类型.

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

看起来 wp_1_posts 表中的 ID 列是一个未签名的 bigint,只是不知道该怎么做...

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

推荐答案

在 MySQL.tt 中,有一个检查 (GetSysType),它决定哪个类型去哪个 db 类型.目前我们没有办法判断某些东西是否是未签名的(因为我不知道如何),但您需要做的是对 unsigned bigint 使用ulong".

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.

如果你愿意帮助我们 - 那就太棒了.它只是编写一些代码,从 MySQL.tt 中的模式调用中提取列是否未签名.我不知道该怎么做,我真的很难再找另一份工作:)

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

这篇关于亚音速:“System.UInt64"类型的对象无法转换为“System.Int64"类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆