Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lambda's in VB.net?

In C# I would simply do this:

myIEnumerable.Where(i=>i.ReturnsABool()).any();

How would I do that in VB.net? I'm stuck on how to formulate the lambda..

like image 453
Boris Callens Avatar asked Jan 20 '10 16:01

Boris Callens


People also ask

Which is a valid type for the lambda function?

Lambda expressions can be stored in variables if the variable's type is an interface which has only one method. The lambda expression should have the same number of parameters and the same return type as that method.

What is lambda expression in C# with example?

The expression num => num * 5 is a lambda expression. The => operator is called the "lambda operator". In this example, num is an input parameter to the anonymous function, and the return value of this function is num * 5 . So when multiplyByFive is called with a parameter of 7 , the result is 7 * 5 , or 35 .

What is meant by lambda expression in Python?

A lambda function is a small anonymous function. A lambda function can take any number of arguments, but can only have one expression.

What is a lambda function Java?

Lambda expressions basically express instances of functional interfaces (An interface with single abstract method is called functional interface. An example is java.lang.Runnable). lambda expressions implement the only abstract function and therefore implement functional interfaces.


1 Answers

Try this

myIEnumerable.Where(Function (i) i.ReturnsABool()).Any()
like image 75
JaredPar Avatar answered Oct 17 '22 20:10

JaredPar