check if list contains elements that are already in the list c# code example Example: list contains type c# if (within.OfType<Ball>().Any())