Expression.Compilation 0.1.1

Roslyn Scripting provide awesome compilation of any C# expression. Roslyn.Scripting has one disadwantage now:
           for any single script parse it creates separate assembly in current AppDomain. Now there is no ability to unload
           such assemblies even they are not used anymore.

           ExpressionCompiler creates DynamicMethod based on your expression without loading additional assemblies in the app
           domain. DynamicMethod can be garbage collected as usual class when it no longer used.

There is a newer version of this package available.
See the version list below for details.
Install-Package Expression.Compilation -Version 0.1.1
dotnet add package Expression.Compilation --version 0.1.1
<PackageReference Include="Expression.Compilation" Version="0.1.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Expression.Compilation --version 0.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Expression.Compilation, 0.1.1"
For F# scripts that support #r syntax, copy this into the source code to reference the package.

ExpressionCompiler

Create DynamicMethod based on text expression. Supports full C# expression syntax.

Roslyn Scripting provide awesome compilation of any C# expression. Roslyn.Scripting has one disadwantage now:
for any single script parse it creates separate assembly in current AppDomain. Now there is no ability to unload
such assemblies even they are not used anymore.

ExpressionCompiler creates DynamicMethod based on your expression without loading additional assemblies in the app
domain. DynamicMethod can be garbage collected as usual class when it no longer used.

Usage:

Func<int> calculator = new ExpressionCompiler("1 + 1").Returns(typeof(int)).Compile<Func<int>>();
Console.WriteLine(calculator.Invoke()); // Prints 2

ExpressionCompiler

Create DynamicMethod based on text expression. Supports full C# expression syntax.

Roslyn Scripting provide awesome compilation of any C# expression. Roslyn.Scripting has one disadwantage now:
for any single script parse it creates separate assembly in current AppDomain. Now there is no ability to unload
such assemblies even they are not used anymore.

ExpressionCompiler creates DynamicMethod based on your expression without loading additional assemblies in the app
domain. DynamicMethod can be garbage collected as usual class when it no longer used.

Usage:

Func<int> calculator = new ExpressionCompiler("1 + 1").Returns(typeof(int)).Compile<Func<int>>();
Console.WriteLine(calculator.Invoke()); // Prints 2

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
0.2.0 258 7/25/2019
0.1.2 459 6/14/2018
0.1.1 429 6/14/2018