score:21

Accepted answer

why don't you use string.join(ienumerable) method?

data.groupby(x => x.category).select(g => new
{
    category = g.key,
    description = string.join(",", g.select(x => x.text))
});

with aggregate you should do following:

    description = g.aggregate(string.empty, (x, i) => x + "," + i.text)

first parameter sets seed start value to string.empty. second parameter defines method to concatenate current seed value (string) with current element (anonymous_type).

score:6

data.groupby(x => x.category).select(g => new
    {
        category = g.key,
        description = g.select(x => x.text).aggregate((s1, s2) => s1 + "," + s2)
     });

Related Query

More Query from same tag