C# .NET Tip Lambda expressions vs LINQ

--

Lambda expressions typically perform faster than LINQ expressions because the compiler translates the query expression into its equivalent Lambda expression before compiling it.

var result = select salary from Employee
where salary < 5000
select salary +10;

This is exactly the same as

var result = Employee
.Where(salary => salary < 5000)
.Select(salary => salary + 10);

Thanks for reading.

--

--

No responses yet