I have an array of string :
string[] PropertyIds= new string[5];
A List of Class(Property)
List<Property> properties = new List<Property>();
The class Property has following fields:
PropertyId (string) and PropertyDesc (string)
I have to find all the values of PropertyId in array PropertyIds, which are not in List properties.
e.g.
string[] PropertyIds= new string[] { "one", "two", "three" };
List<Property> properties = new List<Property>()
{
new Property("one","This is p1"),
new Property("Five","This is p5"),
new Property("six","This is p6"),
};
Then my result should be two and three.
Use Enumerable.Except to get difference from two sequences: