Getting employee details according to the role
You can  use linq GroupBy and Select to reduce your list to distinct RoleTitle's in your foreach loop:

foreach(Role role in emp.Roles.GroupBy(r=&gt; r.RoleTitle).Select(g =&gt; g.First()))
{
    //...
}