using System.Collections.Generic;
public static void Main()
var sampleObjects = new[]
PgId = new List<string> { "abc" },
DcId = new List<string> { "123" }
PgId = new List<string> { "def" },
DcId = new List<string> { "456" }
PgId = new List<string> { "abc" },
DcId = new List<string> { "123" }
var result = sampleObjects
(k, g) => new SampleObject
PgId = g.SelectMany(p => p.PgId).Distinct().ToList(),
DcId = g.SelectMany(p => p.DcId).Distinct().ToList()
foreach(var item in result)
Console.WriteLine(" MsfId:{0}", item.MsfId);
Console.WriteLine(" PgId:{0}", string.Join(", ", item.PgId));
Console.WriteLine(" DcId:{0}", string.Join(", ", item.DcId));
public class SampleObject
public int MsfId { get; set; }
public List<string> PgId { get; set; }
public List<string> DcId { get; set; }