using System.Collections.Generic;
public string ID { get; set; }
public string Name { get; set; }
public static void Main()
List<Person> persons = new List<Person>
new Person { ID = "ABC123", Name = "John" },
new Person { ID = "DEF456", Name = "Alice" },
new Person { ID = "GHI789", Name = "Bob" }
Dictionary<string, Person> dictionary = persons.ToDictionary(person => person.ID, StringComparer.OrdinalIgnoreCase);
string idToCheck = "abc123";
bool containsID = dictionary.ContainsKey(idToCheck);
Console.WriteLine("Dictionary contains ID '{0}': {1}", idToCheck, containsID);