-
Notifications
You must be signed in to change notification settings - Fork 841
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
InsertOrUpdateDict中null值插入成空字符串'' #1785
Comments
批量确实会有这个问题,目前是采用第一条记录的值作为映射类型。 |
表面上是弱类型映射,实际内部操作是使用值的类型作为强类型映射的。 |
我以为是第一条的值,但是测试下来,发现把有null的元素放在第一个,同样有这个问题。 |
恩,这个能理解的。批量插入时,如果是每条数据的每个字段都要重新检查下类型,应该就OK了。 |
嗯,提示尽量不要传null值 |
用freesql做数据迁移工具,不得不处理null的情况233. |
了解下源码,可以修改内部 _table 映射成 int?/long? 就不用考虑 null 问题了。 |
确实,全引用的。 反正数据库那边, '1'这种,插入int类型的字段也是OK的 |
问题描述及重现代码:
这种情况下,在日志中发现,第2个
Name
和Time
被处理成'',导致插入数据库为空字符串或0时间。测试情况:
目前我可以修改为循环,一次只保证数组里只有一个元素,就能正常处理了
数据库版本
Mysql 8.0
安装的Nuget包
FreeSql.Provider.MySql 3.2.821
.net framework/. net core? 及具体版本
.net 6
The text was updated successfully, but these errors were encountered: