Skip to content

Commit b9f30c9

Browse files
Update README.md
1 parent 8eff5e2 commit b9f30c9

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed

README.md

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,16 @@ It allows you to evaluate, Compile and Execute dynamic C# code and expression at
55

66
*From simple C# math expression...*
77
```csharp
8+
// @nuget: Z.Expressions.Eval
9+
using Z.Expressions;
10+
811
int result = Eval.Execute<int>("X + Y", new { X = 1, Y = 2});
912
```
1013
*To complex code to parse.*
1114
```csharp
15+
// @nuget: Z.Expressions.Eval
16+
using Z.Expressions;
17+
1218
int result = Eval.Execute<int>(@"
1319
var list = new List<int>() { 1, 2, 3, 4, 5 };
1420
var filter = list.Where(x => x < 4);
@@ -33,21 +39,27 @@ _* PRO Version unlocked for the current month_
3339
_Anonymous Class_
3440

3541
```csharp
36-
// using Z.Expressions; // Don't forget to include this.
42+
// @nuget: Z.Expressions.Eval
43+
using Z.Expressions;
44+
3745
int result = Eval.Execute<int>("X + Y", new { X = 1, Y = 2});
3846
```
3947

4048
_Argument Position_
4149

4250
```csharp
43-
// using Z.Expressions; // Don't forget to include this.
51+
// @nuget: Z.Expressions.Eval
52+
using Z.Expressions;
53+
4454
int result = Eval.Execute<int>("{0} + {1}", 1, 2);
4555
```
4656

4757
_Class Member_
4858

4959
```csharp
50-
// using Z.Expressions; // Don't forget to include this.
60+
// @nuget: Z.Expressions.Eval
61+
using Z.Expressions;
62+
5163
dynamic expandoObject = new ExpandoObject();
5264
expandoObject.X = 1;
5365
expandoObject.Y = 2;
@@ -57,7 +69,9 @@ int result = Eval.Execute<int>("X + Y", expandoObject);
5769
_Extension Methods_
5870

5971
```csharp
60-
// using Z.Expressions; // Don't forget to include this.
72+
// @nuget: Z.Expressions.Eval
73+
using Z.Expressions;
74+
6175
string s = "X + Y";
6276
int result = s.Execute<int>(new { X = 1, Y = 2 });
6377
```
@@ -70,7 +84,9 @@ int result = s.Execute<int>(new { X = 1, Y = 2 });
7084

7185
*Custom Delegate*
7286
```csharp
73-
// using Z.Expressions; // Don't forget to include this.
87+
// @nuget: Z.Expressions.Eval
88+
using Z.Expressions;
89+
7490
var compiled = Eval.Compile<Func<int, int, int>>("X + Y", "X", "Y");
7591
foreach(var item in list)
7692
{
@@ -80,7 +96,9 @@ foreach(var item in list)
8096

8197
*Extension Methods*
8298
```csharp
83-
// using Z.Expressions; // Don't forget to include this.
99+
// @nuget: Z.Expressions.Eval
100+
using Z.Expressions;
101+
84102
string s = "X + Y";
85103
var compiled = s.Compile<Func<int, int, int>>("X", "Y");
86104
foreach(var item in list)

0 commit comments

Comments
 (0)