c# check if list object contains code example
Example 1: check if list of objects contains value c#
bool contains = pricePublicList.Any(p => p.Size == 200);
Example 2: how to check which item is in an object property c#
var matches = myList.Where(p => p.Name == nameToExtract);