// C# Eval Expression
// Doc: https://eval-expression.net/options
// @nuget: Z.Expressions.Eval
/*
## UseShortCacheKey
The UseShortCacheKey option lets you get or set if the cache key should be shortened. Enabling that option can increase performance, but ensure to read the full `UseShortCacheKey ` documentation before using it. By default, the UseShortCacheKey value is `false`.
In this example, we will set the `UseShortCacheKey = true` and execute dynamically a very simple arithmetic expression.
See more: https://eval-expression.net/options
*/
using System;
using System.Collections.Generic;
using System.Reflection;
using Z.Expressions;
public class Program
{
public static void Main()
// Global Context: EvalManager.UseShortCacheKey = true;
var context = new EvalContext();
context.UseShortCacheKey = true;
Console.WriteLine("1 - Result: " + context.Execute("1 + 2"));
}