Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions docs/csharp/misc/cs0765.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public partial class PartClass : IEnumerable
}
```

## See Also
[Partial Classes and Methods](../../csharp/programming-guide/classes-and-structs/partial-classes-and-methods.md)
[Expression Trees](http://msdn.microsoft.com/library/fb1d3ed8-d5b0-4211-a71f-dd271529294b)
## See also

[Partial Classes and Methods](../../csharp/programming-guide/classes-and-structs/partial-classes-and-methods.md)
[Expression Trees (C#)](../programming-guide/concepts/expression-trees/index.md)
5 changes: 3 additions & 2 deletions docs/csharp/misc/cs0838.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@ namespace TestNamespace
}
```

## See Also
[Expression Trees](http://msdn.microsoft.com/library/fb1d3ed8-d5b0-4211-a71f-dd271529294b)
## See also

[Expression Trees (C#)](../programming-guide/concepts/expression-trees/index.md)
7 changes: 4 additions & 3 deletions docs/csharp/misc/cs1945.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class Test
}
```

## See Also
[Expression Trees](http://msdn.microsoft.com/library/fb1d3ed8-d5b0-4211-a71f-dd271529294b)
[Statements, Expressions, and Operators](../../csharp/programming-guide/statements-expressions-operators/index.md)
## See also

[Expression Trees (C#)](../programming-guide/concepts/expression-trees/index.md)
[Statements, Expressions, and Operators](../../csharp/programming-guide/statements-expressions-operators/index.md)
5 changes: 3 additions & 2 deletions docs/csharp/misc/cs1951.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ class Test
}
```

## See Also
[Expression Trees](http://msdn.microsoft.com/library/fb1d3ed8-d5b0-4211-a71f-dd271529294b)
## See also

[Expression Trees (C#)](../programming-guide/concepts/expression-trees/index.md)
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ An anonymous function is an "inline" statement or expression that can be used wh
## C# Language Specification
[!INCLUDE[CSharplangspec](~/includes/csharplangspec-md.md)]

## See Also
[Statements, Expressions, and Operators](../../../csharp/programming-guide/statements-expressions-operators/index.md)
[Lambda Expressions](../../../csharp/programming-guide/statements-expressions-operators/lambda-expressions.md)
[Delegates](../../../csharp/programming-guide/delegates/index.md)
[Expression Trees](http://msdn.microsoft.com/library/fb1d3ed8-d5b0-4211-a71f-dd271529294b)
## See also

[Statements, Expressions, and Operators](../../../csharp/programming-guide/statements-expressions-operators/index.md)
[Lambda Expressions](../../../csharp/programming-guide/statements-expressions-operators/lambda-expressions.md)
[Delegates](../../../csharp/programming-guide/delegates/index.md)
[Expression Trees (C#)](../concepts/expression-trees/index.md)
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ DoWork();
## Lambda expressions
Lambda expressions represent "inline methods" that have no name but can have input parameters and multiple statements. They are used extensively in LINQ to pass arguments to methods. Lambda expressions are compiled to either delegates or expression trees depending on the context in which they are used. For more information, see [Lambda Expressions](../../../csharp/programming-guide/statements-expressions-operators/lambda-expressions.md).

## Expression trees
Expression trees enable expressions to be represented as data structures. They are used extensively by LINQ providers to translate query expressions into code that is meaningful in some other context, such as a SQL database. For more information, see [Expression Trees](http://msdn.microsoft.com/library/fb1d3ed8-d5b0-4211-a71f-dd271529294b).
## Expression trees

Expression trees enable expressions to be represented as data structures. They are used extensively by LINQ providers to translate query expressions into code that is meaningful in some other context, such as a SQL database. For more information, see [Expression Trees (C#)](../concepts/expression-trees/index.md).

## Expression body definitions

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ You do not use lambda expressions directly in query syntax, but you do use them
## Compiling the Code
To run this code, copy and paste the method into the `StudentClass` that is provided in [How to: Query a Collection of Objects](../../../csharp/programming-guide/linq-query-expressions/how-to-query-a-collection-of-objects.md) and call it from the `Main` method.

## See Also
[Lambda Expressions](../../../csharp/programming-guide/statements-expressions-operators/lambda-expressions.md)
[Expression Trees](http://msdn.microsoft.com/library/fb1d3ed8-d5b0-4211-a71f-dd271529294b)
## See also

[Lambda Expressions](../../../csharp/programming-guide/statements-expressions-operators/lambda-expressions.md)
[Expression Trees (C#)](../concepts/expression-trees/index.md)
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ helpviewer_keywords:
ms.assetid: 57e3ba27-9a82-4067-aca7-5ca446b7bf93
---
# Lambda Expressions (C# Programming Guide)
A lambda expression is an [anonymous function](../../../csharp/programming-guide/statements-expressions-operators/anonymous-methods.md) that you can use to create [delegates](../../../csharp/programming-guide/delegates/using-delegates.md) or [expression tree](http://msdn.microsoft.com/library/fb1d3ed8-d5b0-4211-a71f-dd271529294b) types. By using lambda expressions, you can write local functions that can be passed as arguments or returned as the value of function calls. Lambda expressions are particularly helpful for writing LINQ query expressions.

A lambda expression is an [anonymous function](anonymous-methods.md) that you can use to create [delegates](../delegates/using-delegates.md) or [expression tree](../concepts/expression-trees/index.md) types. By using lambda expressions, you can write local functions that can be passed as arguments or returned as the value of function calls. Lambda expressions are particularly helpful for writing LINQ query expressions.

To create a lambda expression, you specify input parameters (if any) on the left side of the lambda operator [=>](../../../csharp/language-reference/operators/lambda-operator.md), and you put the expression or statement block on the other side. For example, the lambda expression `x => x * x` specifies a parameter that’s named `x` and returns the value of `x` squared. You can assign this expression to a delegate type, as the following example shows:
To create a lambda expression, you specify input parameters (if any) on the left side of the lambda operator [=>](../../../csharp/language-reference/operators/lambda-operator.md), and you put the expression or statement block on the other side. For example, the lambda expression `x => x * x` specifies a parameter that’s named `x` and returns the value of `x` squared. You can assign this expression to a delegate type, as the following example shows:

```csharp
delegate int del(int i);
Expand Down Expand Up @@ -52,8 +53,9 @@ namespace ConsoleApplication1

All restrictions that apply to anonymous methods also apply to lambda expressions. For more information, see [Anonymous Methods](../../../csharp/programming-guide/statements-expressions-operators/anonymous-methods.md).

## Expression Lambdas
A lambda expression with an expression on the right side of the => operator is called an *expression lambda*. Expression lambdas are used extensively in the construction of [Expression Trees](http://msdn.microsoft.com/library/fb1d3ed8-d5b0-4211-a71f-dd271529294b). An expression lambda returns the result of the expression and takes the following basic form:
## Expression Lambdas

A lambda expression with an expression on the right side of the => operator is called an *expression lambda*. Expression lambdas are used extensively in the construction of [Expression Trees](../concepts/expression-trees/index.md). An expression lambda returns the result of the expression and takes the following basic form:

```csharp
(input-parameters) => expression
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ End Module
End Sub
```

## See Also
[Anonymous Types](../../../visual-basic/programming-guide/language-features/objects-and-classes/anonymous-types.md)
[Expression Trees](http://msdn.microsoft.com/library/fb1d3ed8-d5b0-4211-a71f-dd271529294b)
[How to: Use Expression Trees to Build Dynamic Queries](http://msdn.microsoft.com/library/1e37e0cc-eef3-48bb-8b69-3adabf322735)
## See also

[Anonymous Types (Visual Basic)](../../../visual-basic/programming-guide/language-features/objects-and-classes/anonymous-types.md)
[Expression Trees (Visual Basic)](../../programming-guide/concepts/expression-trees/index.md)
[How to: Use Expression Trees to Build Dynamic Queries (Visual Basic)](../../programming-guide/concepts/expression-trees/how-to-use-expression-trees-to-build-dynamic-queries.md)
6 changes: 3 additions & 3 deletions docs/visual-basic/misc/bc36534.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ Most expressions can be converted into expression trees, but some cannot. This e

**Error ID:** BC36534

## See Also
[How to: Use Expression Trees to Build Dynamic Queries](http://msdn.microsoft.com/library/1e37e0cc-eef3-48bb-8b69-3adabf322735)
## See also

[How to: Use Expression Trees to Build Dynamic Queries (Visual Basic)](../programming-guide/concepts/expression-trees/how-to-use-expression-trees-to-build-dynamic-queries.md)
8 changes: 4 additions & 4 deletions docs/visual-basic/misc/bc36603.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ End Module

**Error ID:** BC36603

## See Also
[How to: Use Expression Trees to Build Dynamic Queries](http://msdn.microsoft.com/library/1e37e0cc-eef3-48bb-8b69-3adabf322735)
[Array dimensions in Visual Basic](~/docs/visual-basic/programming-guide/language-features/arrays/array-dimensions.md)
## See also

[How to: Use Expression Trees to Build Dynamic Queries (Visual Basic)](../programming-guide/concepts/expression-trees/how-to-use-expression-trees-to-build-dynamic-queries.md)
[Array dimensions in Visual Basic](../programming-guide/language-features/arrays/array-dimensions.md)