|
1 | 1 | --- |
2 | 2 | layout: default |
3 | 3 | title: Eval Manager |
| 4 | +description: Static manager class for options shared between all instances. |
4 | 5 | permalink: eval-manager |
5 | 6 | --- |
6 | 7 |
|
7 | 8 | {% include template-h1.html %} |
8 | 9 |
|
9 | | -## Introduction |
10 | | -The EvalManager static class keep global configuration shared between evaluation instance. |
| 10 | +## Description |
| 11 | +{{ page.description }} |
11 | 12 |
|
12 | 13 | ## Cache |
13 | | -### Problem |
14 | | -You want to use your own cache to cache compiled lambda expression. |
15 | | - |
16 | | -### Solution |
17 | | -You can change the shared cache by any cache inheriting from System.Runtime.Caching.ObjectCache class. |
| 14 | +Gets or sets the cache to use to cache compiled delegate. |
18 | 15 |
|
19 | 16 | ### Example |
20 | | -```csharp |
| 17 | +{% highlight csharp %} |
21 | 18 | // using Z.Expressions; // Don't forget to include this. |
22 | 19 | EvalManager.Cache = MemoryCache.Default; |
23 | | -``` |
| 20 | +{% endhighlight %} |
24 | 21 |
|
25 | 22 | > You can use your own cache provider inheriting from System.Runtime.Caching.ObjectCache |
26 | 23 |
|
27 | 24 | ## DefaultContext |
28 | | -### Problem |
29 | | -You want to change default configuration for all evaluations context. |
| 25 | +Gets or sets the default context to use for all operations using the default context. |
30 | 26 |
|
31 | | -### Solution |
32 | | -Change default EvalContext configuration to |
33 | | - - [Register & Unregister](https://github.com/zzzprojects/Eval-Expression.NET/wiki/EvalContext-Register-&-Unregister) |
34 | | - - [Change Options](https://github.com/zzzprojects/Eval-Expression.NET/wiki/EvalContext-Options) |
| 27 | +You can also directly change options |
| 28 | + - [Register & Unregister](register-unregister) |
| 29 | + - [Options](options) |
35 | 30 |
|
36 | 31 | The default context is used in static methods: |
37 | | -- [Eval.Execute](https://github.com/zzzprojects/Eval-Expression.NET/wiki/Eval-Execute) |
38 | | -- [Eval.Compile](https://github.com/zzzprojects/Eval-Expression.NET/wiki/Eval-Compile) |
39 | | -- ["string".Execute](https://github.com/zzzprojects/Eval-Expression.NET/wiki/Extension-Methods) |
40 | | -- ["string".Compile](https://github.com/zzzprojects/Eval-Expression.NET/wiki/Extension-Methods) |
41 | | -- [Dynamic LINQ](https://github.com/zzzprojects/Eval-Expression.NET/wiki/LINQ-Dynamic) |
| 32 | +- [Eval.Execute](eval-execute) |
| 33 | +- [Eval.Compile](eval-compile) |
| 34 | +- [LINQ Dynamic](linq-dynamic) |
| 35 | +- [string".Execute](string-extensions#stringexecute) |
| 36 | +- [string".Compile](string-extensions#stringcompile) |
42 | 37 |
|
43 | 38 | ### Example |
44 | | -```csharp |
| 39 | +{% highlight csharp %} |
45 | 40 | // using Z.Expressions; // Don't forget to include this. |
46 | 41 | EvalManager.DefaultContext.RegisterExtensionMethod(typeof(Z.ExtensionMethods)) |
47 | 42 |
|
48 | 43 | // Make member case insensitive (Math.pOW = Math.Pow) |
49 | 44 | EvalManager.DefaultContext.BindingFlags = BindingFlags.IgnoreCase | context.BindingFlags |
50 | | -``` |
| 45 | +{% endhighlight %} |
51 | 46 |
|
52 | 47 |
|
0 commit comments