C# Eval Expression The most powerful C# expression evaluator to execute C# code and dynamic LINQ at runtime


Downloaded more than
0
times !
// Easy to use
int result = Eval.Execute<int>("X + Y", new { X = 1, Y = 2})

// Even with Entity Framework and LINQ
string userInput = "x.Status == 'Active'";
var customers = context.Customers.Where(x => userInput).ToList();

What is C# Eval Expression?

What is C# Eval Expression?

This library is an expression evaluation for people that want to evaluate string as code at runtime.

Is it free?

Is it free?

All LINQ methods are 100% free (unlimited characters). Free up to 50 characters for Execute and Compile methods.

Do you offer a free trial?

Do you offer a free trial?

We offer a monthly trial. You can download the latest version to extend your trial every month!

Our achievements


customers 5,000+ Customers
countries 75+ Countries
requests 10,000+ Requests closed
downloads 250,000,000+downloads

What ZZZ Projects achieved over the last decade has grown beyond our hopes. We help developers worldwide with free and paid solutions (because nobody works for free, nor our developers!). Every day, we are committed to listening to our clients to help ease the daily dev workload as much as possible.


Execute C# Code

Use the Execute method when evaluating a C# expression only once.

var list = new List<int>() { 1, 2, 3, 4 };
var greaterThan = 2;

list = Eval.Execute<List<int>>("list.Where(x => x > greaterThan)", 
   new { list, greaterThan });

Compile C# Code

Use the Compile method when evaluating the same C# expression multiple times but with different parameter values.

var compiled = Eval.Compile<Func<List<int>>>(@"
var list = new List<int>() { 1, 2, 3, 4 };
return list.Where(x => x > 2).ToList();
");

var list = compiled();

LINQ Dynamic

LINQ is great, but using it with dynamic expression makes it awesome!

  • OrderByDynamic
  • SelectDynamic
  • WhereDynamic
  • And more!
var dict = new Dictionary<string, object>();
dict.Add("Statut", 0);
dict.Add("LastLogon", DateTime.Now.AddMonths(-1));
 
var customers = context.Customers
 .WhereDynamic(x => "x.Status == Statut 
                     && x.LastLogon >= LastLogon", dict)
 .ToList();