首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

List<T>用Linq如何写NOT IN (变量)

2013-10-01 
ListT用Linq怎么写NOT IN (变量)string filter1,2,3,4,8PredicateUser match p !(new int?[]

List<T>用Linq怎么写NOT IN (变量)
string filter="1,2,3,4,8"

Predicate<User> match = p => !(new int?[] { 这里的变量怎么写啊? }).Contains(p.ID);
[解决办法]
match = p => !filter.Split(',').Contains(p.ID.ToString());

热点排行