下面的代码有什么问题?
var newContextElementCollection = new List<NewContextElements>();
var res = from eleCollection in newContextElementCollection
where eleCollection.Property.Except(new List<string> { "Password", "Some Other Value" })
select eleCollection;
NewContextElementCollection
班级:
public class NewContextElements
{
public string Property { get; set; }
public string Value { get; set; }
}
我收到此错误:
实例参数:无法从 'string' 转换为 'System.Linq.IQueryable' 错误 2 'string' 不包含 'Except' 的定义和最佳扩展方法重载 'System.Linq.Queryable.Except(System.Linq.可查询,
System.Collections.Generic.IEnumerable)' 有一些无效参数