注册

ef core 7.0包生成sql问题

Xiao 2024/08/08 396 1

为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。
【DM版本】: 8
【操作系统】:win11
【CPU】:
【问题描述】*:使用ef core 7.0 dm包DM.Microsoft.EntityFrameworkCore,新建空的测试程序bool类型映射成TINYINT类型查询可以正常翻译 a.Enabled 会翻译为 "Enabled"=1;但是在项目上把bool类型的字段改成TINYINT类型,数据库的类型也变了,但是查询生成的sql还是不正确,如下
SELECT TOP(:__p_1) "a"."Id", "a"."ConcurrencyStamp", "a"."CreationTime", "a"."ExtraProperties", "a"."IsAbandoned", "a"."JobArgs", "a"."JobName", "a"."LastTryTime", "a"."NextTryTime", "a"."Priority", "a"."TryCount"
FROM "AbpBackgroundJobs" AS "a"
WHERE NOT ("a"."IsAbandoned") AND "a"."NextTryTime" <= :__now_0
ORDER BY "a"."Priority" DESC, "a"."TryCount", "a"."NextTryTime"

"a"."IsAbandoned"还是不会转换成正确的语法

对应的映射为b.Property(x => x.IsAbandoned).HasColumnType(TINYINT);

回答 0
暂无回答
扫一扫
联系客服