c# check if list contains value code example
Example 1: check if list of objects contains value c#
bool contains = pricePublicList.Any(p => p.Size == 200);
Example 2: c# check if array contains value
public static bool Contains(Array a, object val)
{
return Array.IndexOf(a, val) != -1;
}