Use Lambda Function to wrap a query : Lambda « LINQ « VB.Net






Use Lambda Function to wrap a query

 

Imports System
Imports System.Collections.Generic
Imports System.Data
Imports System.Linq
Imports System.Text
Imports System.Globalization

Module Example
   Public Sub Main()

      Dim TestArray As Integer() = New Integer() {1, 2, 3, 4, 5, 6, 7, 8}
      Dim Filter = TestArray.Where(Function(Num As Integer) Num > 3)
      Dim ThisQuery = From ThisElement In Filter Select ThisElement

      For Each TheResult In ThisQuery
         Console.WriteLine(TheResult.ToString())
      Next




   End Sub 
End Module 

   
  








Related examples in the same category

1.Lambda expression syntax
2.Lambda with No Args
3.Lambdas with Multiple Params
4.LINQ query with Enumerable / Lambdas