简体   繁体   中英

Why does VB have more LINQ keywords than C#?

为什么VB有比LIN#更多的LINQ关键字?

If i remember correctly the only 4 keywords that are available to VB.Net and not C# via the query syntax are

VB.Net added these keywords because we felt it would be valuable to our users. We envisioned query syntax being a primary way VB.net users would use LINQ and wanted to enable as many scenarios as possible via the syntax.

I do not know why C# left these out. My speculation is that they didn't feel the scenario justified the cost especially considering the feature is still available via extension methods.

EDIT Added Aggregate and a few others (thanks Dario and Chris!)

The VB team decided to create more language extensions than the C# team did (in terms of keywords that translate to standard query operators). I chalk this up to different teams having different design goals.

Fortunately both languages have full access to all of the standard query operators that are available so there is no loss of functionality.

Check if you have Menu

Tools > Options > Text Editor > C# -> Statment Completation -> Hide advanced members 

unckecked, if this is check means you have members hidden from you. This is created by VS Team for help and simplify tasks to newbies.

对于C#具有VB不具有的LINQ的半“LINQ”的一个关键字是yield

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