Please be kind to a LINQ dummy... Say I have 8 rows data like this:
+-------------------+ | ID WORKTYPEDESC| +-------------------+ | 1 plumber | | 1
Just group by Id, use string.Join to aggregate within each group.
Id
string.Join
IEnumerable<Worktype> source = ...; var query = source.GroupBy( x => x.Id, (id, g) => new Worktype { Id = id, WorktypeDesc = string.Join(";", g.Select(x => x.WorktypeDesc).OrderBy(x => x)) });