c# is value in list of objects code example
Example 1: c# verify in class exist in list
Item wonderIfItsPresent = ...
bool containsItem = myList.Any(item => item.UniqueProperty == wonderIfItsPresent.UniqueProperty);'
Example 2: list contains type c#
if (within.OfType<Ball>().Any())