本文整理汇总了C#中ExpressionGenerator.Split方法的典型用法代码示例。如果您正苦于以下问题:C# ExpressionGenerator.Split方法的具体用法?C# ExpressionGenerator.Split怎么用?C# ExpressionGenerator.Split使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ExpressionGenerator
的用法示例。
在下文中一共展示了ExpressionGenerator.Split方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Test032
public void Test032()
{
var xgr = new ExpressionGenerator();
var e2 = Expression.Default(typeof(bool));
var e3 = Expression.Default(typeof(bool));
var e1 = xgr.WithType<bool>(Expression.Or(e2, e3));
var result = xgr.Split(e1, ExpressionType.And, ExpressionType.Or);
Assert.AreEqual(2, result.Length);
Assert.AreEqual(e2, result[0]);
Assert.AreEqual(e3, result[1]);
}
示例2: Test039
public void Test039()
{
var xgr = new ExpressionGenerator();
var e2 = Expression.Default(typeof(bool));
var e3 = Expression.Default(typeof(bool));
var e4 = Expression.Default(typeof(bool));
var e5 = Expression.Default(typeof(bool));
var e1 = xgr.WithType<bool>(Expression.Or(e2, Expression.And(Expression.Or(e3, e4), e5)));
var result = xgr.Split(e1, ExpressionType.And, ExpressionType.Or);
Assert.AreEqual(4, result.Length);
Assert.AreEqual(e2, result[0]);
Assert.AreEqual(e3, result[1]);
Assert.AreEqual(e4, result[2]);
Assert.AreEqual(e5, result[3]);
}
示例3: Test014
public void Test014()
{
var xgr = new ExpressionGenerator();
var e2 = Expression.Default(typeof(bool));
var e3 = Expression.Default(typeof(bool));
var e4 = Expression.Default(typeof(bool));
var e1 = xgr.WithType<bool>(Expression.And(Expression.And(e2, e3), e4));
var result = xgr.Split(e1, ExpressionType.And);
Assert.AreEqual(3, result.Length);
Assert.AreEqual(e2, result[0]);
Assert.AreEqual(e3, result[1]);
Assert.AreEqual(e4, result[2]);
}