简体   繁体   中英

How do I convert this LINQ query expression from C# to VB.NET?

I have the following C# LINQ query expression:

var duplicatedSSN =
         from p in persons
         group p by p.SSN into g
         where g.Count() > 1
         select g.Key;

Can anyone help me convert this to VB.NET?

Try this

Dim duplicateSSN = From p in persons _
                   Group By Key=p.SSN _
                   Into g = Group _
                   Where g.Count() > 1 _
                   Select Key

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM