c# check if object is in list code example
Example 1: check if list of objects contains value c#
bool contains = pricePublicList.Any(p => p.Size == 200);
Example 2: c# verify in class exist in list
Item wonderIfItsPresent = ...
bool containsItem = myList.Any(item => item.UniqueProperty == wonderIfItsPresent.UniqueProperty);'