From the course: .NET Essentials: Working with LINQ

Unlock this course with a free trial

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

Inline code with lambda expressions

Inline code with lambda expressions - .NET Tutorial

From the course: .NET Essentials: Working with LINQ

Inline code with lambda expressions

- [Instructor] In this video, we look at one of the most important concepts for working with LINQ, the idea here is a lambda expression. These are key, these are essential. It's rare for you to write a query in LINQ without using at least one lambda expression. So we need to know what they are. And in .NET and in C#, these are a way of defining an inline function, which is very important for functional programming concepts. So let's take a look at several syntaxes for creating a lambda expression. We'll start by looking at line seven. Here I'm using one of the delegates that's part of.NET, it's called Func of T. So this represents a function, it's a delegate, and I can then store a function in a variable. And there are many versions of Func of T, some of them take no parameters, you can have multiple parameters. But this one takes an incoming parameter of type int 32, and it returns an int 32, 'cause a function takes…

Contents