private static LambdaExpression Unpack(LambdaExpression expression, Type voidType) { var slimLambda = expression != null ? (LambdaExpressionSlim)expression.ToExpressionSlim() : null; var slimVoidType = voidType?.ToTypeSlim(); return((LambdaExpression)ExpressionSlimTupletizer.Unpack(slimLambda, slimVoidType).ToExpression()); }
private static Expression Pack(Expression expression, params ParameterExpression[] parameters) { var slimExpression = expression?.ToExpressionSlim(); var slimParameters = parameters?.Select(p => (ParameterExpressionSlim)p.ToExpressionSlim()).ToArray(); ExpressionSlimTupletizer.Pack(slimExpression, slimParameters); // This helper should only be used for argument checks... throw new Exception(); }
private static void Unpack(LambdaExpression expression, out Expression body, out IEnumerable <ParameterExpression> parameters) { var slimLambda = expression != null ? (LambdaExpressionSlim)expression.ToExpressionSlim() : null; ExpressionSlimTupletizer.Unpack(slimLambda, out var slimBody, out var slimParameters); var fatLambda = (LambdaExpression)ExpressionSlim.Lambda(slimBody, slimParameters).ToExpression(); body = fatLambda.Body; parameters = fatLambda.Parameters; }
private static bool IsTuple(Type type) { return(ExpressionSlimTupletizer.IsTuple(type.ToTypeSlim())); }
private static IEnumerable <Expression> Unpack(Expression expression) { var slimExpression = expression?.ToExpressionSlim(); return(ExpressionSlimTupletizer.Unpack(slimExpression).Select(x => x.ToExpression())); }
private static LambdaExpression Unpack(LambdaExpression expression) { var slimLambda = expression != null ? (LambdaExpressionSlim)expression.ToExpressionSlim() : null; return((LambdaExpression)ExpressionSlimTupletizer.Unpack(slimLambda).ToExpression()); }
private static Expression Pack(IEnumerable <Expression> expressions) { var slimExpressions = expressions?.Select(e => e.ToExpressionSlim()); return(ExpressionSlimTupletizer.Pack(slimExpressions).ToExpression()); }