-
Notifications
You must be signed in to change notification settings - Fork 856
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在 ISelect 中对 byte[] 的长度进行 == 比较时出现异常 #505
Labels
bug
Something isn't working
Comments
byte[] 的方法确实没有做解析,貌似各数据库之间不通用? 临时方案,用自定义方法解析解决: [ExpressionCall]
public static class DbFunc {
static ThreadLocal<ExpressionCallContext> context = new ThreadLocal<ExpressionCallContext>();
public static DateTime SqlLength(this byte[] that)
{
var up = context.Value;
if (up.DataType == FreeSql.DataType.SqlServer)
up.Result = $"len({up.ParsedContent["that"]})"; //不确定是不是用 len
return that;
}
} |
是的,每个都不太一样,比如 SqlServer 使用的是 |
已可以通过 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
情况说明:
0、当前使用的版本号是 1.10.1
1、我在数据库(假设是 SqlServer)中预设两个字段,一个字段名叫
ByteArray
类型为varbinary(2000)
、另一个字段名叫ByteLength
类型为int
2、假设我有以下模型:
3、我在检索数据时,使用如下伪代码:
4、执行上述操作后抛出异常:
5、StackTrace 信息:
6、所生成的 SQL 语句样本(片段):
The text was updated successfully, but these errors were encountered: