c# if any item in list equals another item in list code example Example: list contains type c# if (within.OfType<Ball>().Any())