DotNetWorkQueue.LinqCompile.LinqCompiler.CompileFunction C# (CSharp) Method

CompileFunction() public method

Compiles the input linqExpression into a Linq expression tree
public CompileFunction ( LinqExpressionToRun linqExpression ) : Func
linqExpression DotNetWorkQueue.Messages.LinqExpressionToRun The linqExpression.
return Func
        public Func<object, object, object> CompileFunction(LinqExpressionToRun linqExpression)
        {
            Guard.NotNull(() => linqExpression, linqExpression);
            Guard.NotNullOrEmpty(() => linqExpression.Linq, linqExpression.Linq);
            var compiler = _objectPool.GetObject();
            try
            {
                return compiler.CompileFunction(linqExpression);
            }
            catch (Exception error)
            {
                throw new CompileException($"Failed to compile linq expression [{linqExpression.Linq}]", error,
                    linqExpression.Linq);
            }
            finally
            {
                _objectPool.ReturnObject(compiler);
            }
        }