0
我有以下顺序:排除出现在另一个序列元素
public static List<string> IgnoredSubCodes => new List<string> {"HERE", "NOT_HERE"};
var demographics = personify.CUS_DEMOGRAPHIC.Where(demographic =>
clubIds.Contains(demographic.MASTER_CUSTOMER_ID) &&
distinctCodes.Contains(demographic.DEMOGRAPHIC_CODE) &&
distinctProgramYears.Contains(demographic.USR_PROGRAM_YEAR) &&
!demographic.DEMOGRAPHIC_SUBCODE.Any(x => PersonifyConstants.DemographicCodes.DemographicSubCodes.IgnoredSubCodes));
上面的最后一行将无法正常工作,但我希望能够说“不包括出现在此列表中的任何人口统计子代码“。我怎样才能做到这一点?我已经尝试了几个与.Where和.Any不同的子句,但我不了解我需要的排列方式。我可以在demographic.DEMOGRAPHIC_SUBCODE != "HERE" && demographic.DEMOGRAPHIC_SUBCODE != "NOT_HERE"
这个查询中对它进行硬编码,但是我想在一个地方排除所有的排除。