[Solved] Move duplicates of a list within the list c#


You need to add a property ( i called it Others) to Employee to store the list

employees
    .GroupBy(x => x.EmpID)
    .Select(g => {
        var byPres = g.OrderByDescending(x => x.DateofPresentation).ToArray();
        var e = byPres.First();
        e.Others = byPres.Skip(1).ToList();
        return e;
    })

see demo https://dotnetfiddle.net/kRiMds

0

solved Move duplicates of a list within the list c#