How to write a Lamdba function in VB.NET

0

Note: This is a translation of an OS question in English.

I am working on a VB.net project. I am new with VB.net LINQ and I would like to know the Lambda equivalent of

var _new = orders.Select(x => x.items > 0);

On VB.net

Original question Here

    
asked by eezzekl 28.02.2017 в 15:36
source

1 answer

0

Note: This is a translation of the accepted SO response in English

The syntax of the lamdba is not very different from a regular delegate.

If a lamdba is being created that returns any value, Function is used. Otherwise, if it does not return value use Sub

Dim _new = orders.Select(Function(x) x.Items > 0)

Dim action As Action(Of Item) = Sub(x) Console.WriteLine(x.Items)

Here the original answer

    
answered by 28.02.2017 / 15:36
source