解决 No coercion operator is defin
2019-09-30 本文已影响0人
DF_Sky
Linq Any转换失败:
var isExist = db.MyDbTable.Any(o => o.Id == id);
//throw No coercion operator is defined between types 'System.Int16' and 'System.Boolean',
要改成
var isExist = db.MyDbTable.FirstOrDefault(o => o.Id == id) != null;
亲测 有效