LambdaExpression.Compile Method
In this article
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Produces a delegate that represents the lambda expression.
Overloads
Compile() |
Produces a delegate that represents the lambda expression. |
Compile(Boolean) |
Produces an interpreted or compiled delegate that represents the lambda expression. |
Compile(DebugInfoGenerator) |
Produces a delegate that represents the lambda expression. |
- Source:
- LambdaExpression.cs
- Source:
- LambdaExpression.cs
- Source:
- LambdaExpression.cs
Produces a delegate that represents the lambda expression.
public:
Delegate ^ Compile();
public Delegate Compile();
member this.Compile : unit -> Delegate
Public Function Compile () As Delegate
Returns
A Delegate that contains the compiled version of the lambda expression.
Remarks
The Compile method can be used to convert a LambdaExpression expression tree into the delegate that it represents.
Applies to
.NET 10 and other versions
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.0, 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |
- Source:
- LambdaExpression.cs
- Source:
- LambdaExpression.cs
- Source:
- LambdaExpression.cs
Produces an interpreted or compiled delegate that represents the lambda expression.
public:
Delegate ^ Compile(bool preferInterpretation);
public Delegate Compile(bool preferInterpretation);
member this.Compile : bool -> Delegate
Public Function Compile (preferInterpretation As Boolean) As Delegate
Parameters
- preferInterpretation
- Boolean
true
to indicate that the expression should be compiled to an interpreted form, if it's available; otherwise, false
.
Returns
A delegate that represents the compiled lambda expression described by the LambdaExpression object.
Applies to
.NET 10 and other versions
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.6, 2.0, 2.1 |
- Source:
- LambdaExpression.cs
- Source:
- LambdaExpression.cs
- Source:
- LambdaExpression.cs
Produces a delegate that represents the lambda expression.
public:
Delegate ^ Compile(System::Runtime::CompilerServices::DebugInfoGenerator ^ debugInfoGenerator);
public Delegate Compile(System.Runtime.CompilerServices.DebugInfoGenerator debugInfoGenerator);
member this.Compile : System.Runtime.CompilerServices.DebugInfoGenerator -> Delegate
Public Function Compile (debugInfoGenerator As DebugInfoGenerator) As Delegate
Parameters
- debugInfoGenerator
- DebugInfoGenerator
Debugging information generator used by the compiler to mark sequence points and annotate local variables.
Returns
A delegate containing the compiled version of the lambda.
Applies to
.NET 10 and other versions
Product | Versions |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: