c# contains list code example
Example 1: c# arraylist contains
IList arList = new ArrayList();
arList.Add(100);
arList.Add("Hello World");
arList.Add(300);
Console.WriteLine(arList.Contains(100)); // true
Example 2: list contains type c#
if (within.OfType<Ball>().Any())
Example 3: c# check list of objects for value
var matches = myList.Where(p => p.Name == nameToExtract);