Convert list to dictionary using linq and not worrying about duplicates
LINQ solution: // Use the first value in group var _people = personList .GroupBy(p => p.FirstandLastName, StringComparer.OrdinalIgnoreCase) .ToDictionary(g => g.Key, g => g.First(), StringComparer.OrdinalIgnoreCase); // Use the last value in group var _people = personList .GroupBy(p => p.FirstandLastName, StringComparer.OrdinalIgnoreCase) .ToDictionary(g => g.Key, g => g.Last(), StringComparer.OrdinalIgnoreCase); If you prefer a non-LINQ solution then you could … Read more