-
Notifications
You must be signed in to change notification settings - Fork 861
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
IsNullable 为false 时 能否对Entity值为null的字段 插入默认值? #384
Comments
是的,比如 int 的话本身 isnullable false。 isnullable 基本对 string 才有必要设置 |
因为有string 设了非空 但是insert的时候还是插了null 。所以问问要怎么设置 |
哦,你在说默认值。 isnullable 目前主要是给 codefirst 建表 |
其实就是 CodeFirst 设置为 非空 字段时。 |
这个优化,在 v1.8.0 上做好了 其实用 fsql.Aop.AuditValue 也可以拦截 null 值。 |
Thanks♪(・ω・)ノ |
@2881099 额,请问这null自动转default的功能可以disable掉嘛。我觉得这个功能无意间打破了数据库的约束。因为null和空字符串其实语义上是不一样的,如果ORM自动做了这个转换而不是报错的话,相当于做了业务代码做的事情了。 |
如果是 字符串 就插入 ""
数字就插入 0 ?
The text was updated successfully, but these errors were encountered: