c# how to tell if a value is in a list code example Example: c# check list of objects for value var matches = myList.Where(p => p.Name == nameToExtract);