Compiles the lambda expression described by the expression tree into executable code and produces a delegate that represents the lambda expression.
Assemblies: System.Linq.Expressions (in System.Linq.Expressions.dll)
System.Core (in System.Core.dll)
The Compile method can be used to obtain the value of any expression tree. First, create a lambda expression that has the expression as its body by using the Lambda method. Then call Compile to obtain a delegate, and execute the delegate to obtain the value of the expression.
.NET FrameworkSupported in: 4.6, 4, 3.5
.NET Framework Client ProfileSupported in: 4, 3.5 SP1
Portable Class LibrarySupported in: Portable Class Library
.NET for Windows Store appsSupported in: Windows 8
Supported in: Windows Phone 8.1
Supported in: Windows Phone Silverlight 8.1
Supported in: Windows Phone Silverlight 8
Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.