我有一个列表,例如 List<string> ListProviderKeys
,其中有一些值。
我还有另一个来自下面类的列表,例如 List<ChangesSummary> SecondList;
public class ChangesSummary
{
public string TableName { get; set; }
public string ProviderKey { get; set; }
public string ProviderAdrsKey { get; set; }
public string ProviderSpecialtyKey { get; set; }
public string FieldName{ get; set; }
}
假设第一个列表中包含的值与我们放入第二个列表中的
ProviderKey
字段中的值相同。
现在我想要的是将第二个列表缩减为仅包含其ProviderKey
不在第一个列表中的值。
我该怎么做?我知道有Except运算符,但不确定如何在这种情况下使用它!
Exclude
,尝试使用它。 - Konstantin Zadiran