public static RuntimeExpression CreateCompiled(ExpressionNode expressionNode) { string expressionSource = expressionNode.GenerateSource(); ILEmitContext ilEmitContext = new ILEmitContext(expressionSource); ILParameterRegisterer ilParameterRegisterer = new ILParameterRegisterer(ilEmitContext); ilParameterRegisterer.Visit(expressionNode); ILTranslator ilTranslator = new ILTranslator(ilEmitContext); ilTranslator.Visit(expressionNode); CompiledExpressionDelegate compiledExpressionDelegate = ilEmitContext.CreateDelegate(); object[] arguments = ilEmitContext.GetArguments(); return new CompiledRuntimeExpression(expressionSource, expressionNode.ExpressionType, compiledExpressionDelegate, arguments); }
public static RuntimeExpression CreateCompiled(ExpressionNode expressionNode) { string expressionSource = expressionNode.GenerateSource(); ILEmitContext ilEmitContext = new ILEmitContext(expressionSource); ILParameterRegisterer ilParameterRegisterer = new ILParameterRegisterer(ilEmitContext); ilParameterRegisterer.Visit(expressionNode); ILTranslator ilTranslator = new ILTranslator(ilEmitContext); ilTranslator.Visit(expressionNode); CompiledExpressionDelegate compiledExpressionDelegate = ilEmitContext.CreateDelegate(); object[] arguments = ilEmitContext.GetArguments(); return(new CompiledRuntimeExpression(expressionSource, expressionNode.ExpressionType, compiledExpressionDelegate, arguments)); }