From the course: Visual Basic Essential Training

Unlock this course with a free trial

Join today to access over 24,500 courses taught by industry experts.

Delegates and lambda expressions

Delegates and lambda expressions - Visual Basic Tutorial

From the course: Visual Basic Essential Training

Delegates and lambda expressions

- [Instructor] Delegates and Lambda expressions are essential for understanding how to use LINQ queries, because they provide the tools needed to pass methods as parameters and define inline functionality. LINQk relies heavily on these concepts to perform operations such as filtering, sorting, and extracting data. In addition to their role in LINQ, Delegates and Lambda expressions are also valuable when working with many methods and generic collections and other parts of .NET. Passing functions as arguments is useful in programming because that allows for greater flexibility, modularity, and reusability in code. Here are some of the reasons why this is valuable. Passing a function let us encapsulate specific behavior or logic and pass it to other parts of the program. This way we can define what should be done without hard coding the exact behavior. Functions passed as arguments are commonly used for callbacks where one function is executed after another one has finished. This is…

Contents