Use LINQ to concatenate multiple rows into single row (CSV property)
问题 I\'m looking for the LINQ equivalent to the Sybase\'s LIST() or MySQL\'s group_concat() It\'ll convert: User Hobby -------------- Bob Football Bob Golf Bob Tennis Sue Sleeping Sue Drinking To: User Hobby -------------- Bob Football, Golf, Tennis Sue Sleeping, Drinking 回答1: That's the GroupBy operator. Are you using LINQ to Objects? Here's an example: using System; using System.Collections.Generic; using System.Linq; public class Test { static void Main() { var users = new[] { new { User="Bob"