Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

C# Eval Expression | Evaluate, Compile, and Execute C# code and expression at runtime.

License

NotificationsYou must be signed in to change notification settings

zzzprojects/Eval-Expression.NET

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Eval Expression.NET improves performance dramatically to access public and private methods, field, property value, or create object instances overusing C# reflection.

It allows you to evaluate, Compile and Execute dynamic C# code and expression at runtime.

From simple C# math expression...

// @nuget: Z.Expressions.EvalusingZ.Expressions;intresult=Eval.Execute<int>("X + Y",new{X=1,Y=2});

To complex code to parse.

// @nuget: Z.Expressions.EvalusingZ.Expressions;intresult=Eval.Execute<int>(@"var list = new List<int>() { 1, 2, 3, 4, 5 };var filter = list.Where(x => x < 4);return filter.Sum(x => x);");

Download

download

PM> Install-Package Z.Expressions.Eval

* PRO Version unlocked for the current month

Eval.Execute

Evaluate and execute the code or expression.

Support:

Anonymous Class

// @nuget: Z.Expressions.EvalusingZ.Expressions;intresult=Eval.Execute<int>("X + Y",new{X=1,Y=2});

Argument Position

// @nuget: Z.Expressions.EvalusingZ.Expressions;intresult=Eval.Execute<int>("{0} + {1}",1,2);

Class Member

// @nuget: Z.Expressions.EvalusingZ.Expressions;dynamicexpandoObject=newExpandoObject();expandoObject.X=1;expandoObject.Y=2;intresult=Eval.Execute<int>("X + Y",expandoObject);

Extension Methods

// @nuget: Z.Expressions.EvalusingZ.Expressions;strings="X + Y";intresult=s.Execute<int>(new{X=1,Y=2});

Learn more

Eval.Compile

Compile the code or expression and return a delegate.

Support:

Custom Delegate

// @nuget: Z.Expressions.EvalusingZ.Expressions;varcompiled=Eval.Compile<Func<int,int,int>>("X + Y","X","Y");foreach(variteminlist){intresult=compiled(item.Value1,item.Value2);}

Extension Methods

// @nuget: Z.Expressions.EvalusingZ.Expressions;strings="X + Y";varcompiled=s.Compile<Func<int,int,int>>("X","Y");foreach(variteminlist){intresult=compiled(item.Value1,item.Value2);}

Learn more

What's supported?

Eval Expression.NET supports all C# Syntax:

You can even access C# 6.0 features even if you are using C# 4.0.

  • string interpolation
  • typename
  • null conditional member access

PRO

Every month, a new monthly trial of the PRO Version is available to let you evaluate all its features without limitations.

FeaturesPRO Version
Maximum CharactersUnlimited
Commercial LicenseYes
Royalty-FreeYes
Support & Upgrades (1 year)Yes
Learn more about thePRO Version
  • Starting from version 2.x, there is no longer a free limited version.
  • LINQ extension method is free withEF Classic - Community

Contribute

The best way to contribute is byspreading the word about the library:

  • Blog it
  • Comment it
  • Star it
  • Share it

AHUGE THANKS for your help.

More Projects

To view all our free and paid projects, visit our websiteZZZ Projects.

About

C# Eval Expression | Evaluate, Compile, and Execute C# code and expression at runtime.

Topics

Resources

License

Stars

Watchers

Forks

Contributors5

Languages


[8]ページ先頭

©2009-2025 Movatter.jp