Dim namePriceQuery = From prod In products
Select prod.Name, prod.Price
Dim namePriceQuery = products.select(function(x) New With{ Key .newName =x.name _
, Key .newPrice= x.price})
據我所知,唯一的區別是與第二表達式的Key關鍵字的好處。兩者之間的區別究竟是什麼?我會選擇使用哪種場景?一個和另一個的優缺點是什麼?
我假設C#的語法等效將工作相同,應該用於類似的前提情景。非常感謝你!
可能重複[LINQ:Dot Notation vs Query Expression](http://stackoverflow.com/questions/630045/linq-dot-notation-vs-query-expression) – 2011-04-06 19:18:52
它本身鏈接到另一個愚蠢。 [你喜歡哪種LINQ語法?流利或查詢表達式](http://stackoverflow.com/questions/214500/which-linq-syntax-do-you-prefer-fluent-or-query-expression)都有很好的答案。 – gideon 2011-04-06 19:31:45