I have these code :
var result = new Collection<object>();
result.Add(list.Select(s => new
{
s.ID,
s.Users
})
);
Users is a collection which means it can contains multiple names for example "John", "Rick", "Tom"
, etc. I want to coalsescing it into one string
"John, Rick, Tom"
. Any idea how to achieve this result?
Thank you
UPDATE :
Answer
var result = new Collection<object>();
result.Add(list.Select(s => new
{
s.ID,
Users = string.Join(",", s.Users)
})
);