c# how to check if an item exists in a list by property code example Example: list contains type c# if (within.OfType<Ball>().Any())