我知道如何基于一个列值从表中选择一行,如下所示:var rowFeatureName = db.AfrRules.SingleOrDefault(r => r.FeatureName == FeatureName);但是,如何基于两列来做相同的事情?
1 回答
largeQ
TA贡献2039条经验 获得超7个赞
尝试做一个AND运算
var rowFeatureName = db.AfrRules.Where(r => r.FeatureName == FeatureName && r.FeatureName2 == FeatureName).FirstOrDefault();
或对此进行“或”运算
var rowFeatureName = db.AfrRules.Where(r => r.FeatureName == FeatureName || r.FeatureName2 == FeatureName).FirstOrDefault();
- 1 回答
- 0 关注
- 117 浏览
添加回答
举报
0/150
提交
取消