score:2

Accepted answer

you can try to groupby the country, swiftcode

swiftcodeinfo.groupby(l => new { l.country, l.swiftcode })
             .select(g => new branchcode {
                    country = g.key.country, 
                    swiftcode = g.key.swiftcode, 
                    branchcodes = g.select(i => i.branchcode).tolist() 
                });

c# online


Related Query

More Query from same tag