csharp check if list contains elements form of a list code example Example: list contains type c# if (within.OfType<Ball>().Any())