Wednesday 11 December 2019

C# - LINQ - How to Group List and Convert to Dictionary

 Dictionary<string, List<EmployeeDetails>> result = employeeInfo
                    .GroupBy(empInfo => empInfo.EmployeeName)
                    .ToDictionary(empInfo => empInfo.Key, empInfo => empInfo.ToList());

No comments: