我有一个 Fee 类型列表,我需要从中排除 ID 存在于另一个 int 类型列表中的列表。
List<int> ExcludedFeeIDs = new List<int>{1,2,3,4};
List<Fee> MyFees = (from c in ctx.Fees
select c).ToList();
例子:
列出 GoodFees =(来自 ctx.Fees 中的 f,其中 f.FeeID!=ExcludedFeeIDs 中的 ID 之一);
请帮助?
尝试这个:
var MyFees = from c in ctx.Fees
where !ExcludedFeeIDs.Contains(c.FeeID)
select c;
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)