forked from zzzprojects/System.Linq.Dynamic.Core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRequest_Promote.cs
More file actions
36 lines (30 loc) · 1.2 KB
/
Request_Promote.cs
File metadata and controls
36 lines (30 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System;
using System.Collections.Generic;
using System.Linq.Dynamic.Core;
using System.Linq.Expressions;
using System.Text;
namespace Z.Dynamic.Core.Lab
{
public class Request_Promote
{
public static void Execute()
{
var strArray = new[] { "1", "2", "3", "4" };
var x = new List<ParameterExpression>();
x.Add(Expression.Parameter(strArray.GetType(), "strArray"));
var config = new ParsingConfig();
string query = "string.Join(\",\" , strArray)";
var e = DynamicExpressionParser.ParseLambda(config, x.ToArray(), null, query);
Delegate del = e.Compile();
var result = del.DynamicInvoke(strArray);
//var intArray = new[] { 1, 2, 3, 4 };
//var x = new List<ParameterExpression>();
//x.Add(Expression.Parameter(intArray.GetType(), "intArray"));
//var config = new ParsingConfig();
//string query = "string.Join(\",\" , intArray)";
//var e = DynamicExpressionParser.ParseLambda(config, x.ToArray(), null, query);
//Delegate del = e.Compile();
//var result = del.DynamicInvoke(intArray);
}
}
}