i have a list of Person objects. i want to convert to a dictionary where the key is the first and last name (concatenated) and the value is the Person object.
the issue is that i have some duplicates people so this blows up if i use this code:
private Dictionary<string, Person> _people = new Dictionary<string, Person>();
_people = personList.ToDictionary(e => e.FirstandLastName, StringComparer.OrdinalIgnoreCase);
i know it sounds weird but i dont really care about duplicates names for now. If there are multiple names i just want to grab one. Is there anyway i can write this code above so it just takes one of the names and doesn't blow up on duplicates?