[英]How to update value to null using FluentMigrator
How can I update all rows to null using FluentMigrator fluent syntax?如何使用 FluentMigrator 流畅的语法将所有行更新为 null? You cannot assign null to anonymous type property.
您不能将 null 分配给匿名类型属性。
Update.Table("mytable").Set(new { supplierid = null }).AllRows();
I found the answer to my question.我找到了我的问题的答案。 You must use
DBNull.Value
.您必须使用
DBNull.Value
。
Update.Table("mytable").Set(new { supplierid = DBNull.Value }).AllRows();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.