How to remove duplicate users from a list but amalgamate their roles <p>Say I have a list of People who have a name and a list of roles:</p> <p>Each item in the list is of type PersonDetails:</p> <pre><code>public class PersonDetails { public int Id { get; set; } public string Name { get; set; } public List&lt;Role&gt; Roles { get; set; } } public class Role { public string Name { get; set; } } </code></pre> <p>So in my list of these items I might have the following:</p> <ol> <li>Id 23 Eric whose roles contains a role with Role.Name = "Manager"</li> <li>Id 23 Eric whose roles contains a role with Role.Name = "CEO"</li> <li>Id 23 Eric whose roles contains a role with Role.Name = "CIO"</li> </ol> <p>so that is how it is currently but because it is the same person I want my list to be:</p> <ol> <li>Id 23 Eric whose roles contains "Manager", "CEO", "CIO"</li> </ol> <p>Can anyone tell me how to change my list of items to be like this?</p>