Let’s say I have this object:
public class Role {
public string Name { get; set; }
public string Slug { get; set; }
public DateTime DateAssigned { get; set; }
...
}
A member can have multiple roles: member.Roles = List<Role>();
If I wanted to join the member’s roles into a comma separated list of the role names, is there an easy way (similar to string.Join(",", member.Roles); – which doesn’t work because a role is a complex type)?
1 Answer