类型的操作数我正在尝试第一个筛选器列表,然后使用OrderBy
但我在Where
子句中遇到以下错误运算符'&&'不能应用于类型'bool'和'System.Collections.Generic.IEnumerable <Feature>'
操作“& &”不能应用于类型“布尔”和 的操作数的System.Collections.Generic.IEnumerable“
这有什么错我的查询?
Offer internetOffer = offerList
.Where(x => (x.VerticalType == VerticalType.HighSpeedInternet)
&& (x.FeatureList
.Where(y => y.FeatureName == Const.CommonConstants.DOWNLOAD_SPEED_FEATURE_NAME)))
.OrderByDescending(y => y.Value);
'&&(x.FeatureList.Where(y => y.FeatureName == Const.CommonConstants.DOWNLOAD_SPEED_FEATURE_NAME)'你是不是指'any'? –
你有答案在这里:https://forums.asp.net /t/2065524.aspx?Operator+cannot+be+applied+to+operands+of+type+bool+and+System+Collections+Generic+IEnumerable+bool+ –