假设我是Member
我不想包含的名称的实体和列表。
var excludeNames = new [] { "A","B","C","D"};
var members = db.Members.Except(excludeNames);
或者
var excludeNames = new[]{ "A","B","C","D"};
var Members = db.Members.Where(m=> excludeNames.Where(xcl => xcl != m.Name));
这些都不起作用。我也试过这个:
var excludeNames = new[] { "A","B","C","D"};
var members = from m in db.Members
from xcl in excludeNames
where m.Name != xcl
select m;