when using the "from.. select" form I can assign local variables in Linq with the let statement. How to capture variables with lambdas? Non working example of what I need:
var result = list.Select(a =>
let localVariable = a.number + 2 // <- obviously non working
new {
Variable = localVariable
}
);