我有一段代码:
IList<Opportunity> filteredOpportunityProperties = new List<Opportunity>();
List<LookupWithIntId> selectedProperties = opportunityFilter.PropertyTypes;
List<string> propertyTypes = selectedProperties.Select(item => item.Name).ToList();
opportunities.Where((item) =>
{
string productType = item.Properties[0].ProductType;
bool propertyMatch = propertyTypes.Any(propTypes => productType.Contains(propTypes));
if (propertyMatch) select item;
});
如果条件匹配,我希望选择该项目。但是,我收到错误:
嵌入语句不能是声明或标签语句
有什么建议么!