check if list contains an object c# code example
Example 1: check if list of objects contains value c#
bool contains = pricePublicList.Any(p => p.Size == 200);
Example 2: list contains type c#
if (within.OfType().Any())
Example 3: c# check list of objects for value
var matches = myList.Where(p => p.Name == nameToExtract);