Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
VB.NET lambda表达式示例_Vb.net_Linq - Fatal编程技术网

VB.NET lambda表达式示例

VB.NET lambda表达式示例,vb.net,linq,Vb.net,Linq,在哪里可以找到使用VB.NET Lambda表达式语法制作的复杂LINQ示例 在我的搜索过程中,我总能找到,但它们使用了另一种表示法,对于我来说,并不总是清楚如何将代码转换为lambda表达式。您可以只看一下。对于C#和VB.Net中的每个IEnumerable扩展,它们至少有一个示例 一些随机的例子: ' Select Dim squares As IEnumerable(Of Integer) = _ Enumerable.Range(1, 10).Select(Functi

在哪里可以找到使用VB.NET Lambda表达式语法制作的复杂LINQ示例

在我的搜索过程中,我总能找到,但它们使用了另一种表示法,对于我来说,并不总是清楚如何将代码转换为lambda表达式。

您可以只看一下。对于C#和VB.Net中的每个IEnumerable扩展,它们至少有一个示例

一些随机的例子:

' Select
Dim squares As IEnumerable(Of Integer) = _
        Enumerable.Range(1, 10).Select(Function(x) x * x)

' Aggregate
Dim reversed As String = _
        words.Aggregate(Function(ByVal current, ByVal word) word & " " & current)

' Max
Dim max As Integer = pets.Max(Function(pet) _
                                      pet.Age + pet.Name.Length)

 ' SkipWhile
Dim query As IEnumerable(Of Integer) = _
        amounts.SkipWhile(Function(amount, index) _
                              amount > index * 1000)