【发布时间】:2021-10-08 15:42:38
【问题描述】:
如何更新 1 列以将所有行的值设置为 1,因此我的表有三列 customerno、name、doneflag,我想将所有行的 Doneflag 设置为 1,目前我的表中有 8 行并且所有的值都为 0 作为 Doneflag,我想使用实体框架进行一次更新以将所有行的 doneflag 设置为 1,这很简单,因为它会使用 Mysql:
update myDB.Customer
set doneflag = 0;
我试过了,但是不行;
context.Customer.Add(x => x.Doneflag = 1);
【问题讨论】:
标签: linq asp.net-core .net-core entity-framework-core