首页 新闻 会员 周边

EFCore.BulkExtensions 批量更新操作为啥Flase时失败

0
悬赏园豆:50 [待解决问题]

var list = ids.Split(',').Select(p => TypeParse.ToInt(p)).Where(p => p > 0).Distinct();

_context.Users.Where(p => list.Contains(p.ID)).BatchUpdate(new UserModel { State = true });

_context.Users.Where(p => list.Contains(p.ID)).BatchUpdate(new UserModel { State = false });

为什么state=true时更新是对的,false的时候报异常

System.InvalidOperationException:“SET Columns not defined. If one or more columns should be updated to theirs default value use 'updateColumns' argument.”

狼哥哥star的主页 狼哥哥star | 初学一级 | 园豆:152
提问于:2019-07-29 16:07
< >
分享
所有回答(1)
0

你使用的数据库是?这个包貌似只支持 mssql

ohyex | 园豆:1496 (小虾三级) | 2019-07-29 17:29
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册