private static List <CommandExpression> MergeArguments(CommandExpression argument, IEnumerable <object> arguments)
        {
            var collection = new List <CommandExpression>();

            collection.Add(argument);
            collection.AddRange(arguments.Select(CommandExpression.FromValue));
            return(collection);
        }
Ejemplo n.º 2
0
 private static string FormatExpression(CommandExpression expr)
 {
     if (ReferenceEquals(expr, null))
     {
         return("null");
     }
     else
     {
         return(expr.Format());
     }
 }
Ejemplo n.º 3
0
        private void EvaluateExpressions()
        {
            if (!ReferenceEquals(_tableExpression, null))
            {
                From(_tableExpression.AsString());
                _tableExpression = null;
            }

            if (!ReferenceEquals(_whereExpression, null))
            {
                _where           = _whereExpression.Format();
                _whereExpression = null;
            }
        }
Ejemplo n.º 4
0
        private bool NeedsGrouping(CommandExpression expr)
        {
            if (_operator == ExpressionOperator.None)
            {
                return(false);
            }
            if (ReferenceEquals(expr, null))
            {
                return(false);
            }
            if (expr._operator == ExpressionOperator.None)
            {
                return(false);
            }

            int outerPrecedence = GetPrecedence(_operator);
            int innerPrecedence = GetPrecedence(expr._operator);

            return(outerPrecedence < innerPrecedence);
        }
 public ICommandBuilder <ResultRow> From(CommandExpression expression)
 {
     return(new CommandBuilder <ResultRow>(expression));
 }
 public ICommandBuilder <object> From(CommandExpression expression)
 {
     return(new CommandBuilder <object>(expression));
 }
 protected CommandExpression(CommandExpression caller, ExpressionFunction function)
 {
     _functionCaller = caller;
     this.Function   = function;
 }
 protected CommandExpression(CommandExpression caller, string reference)
 {
     _functionCaller = caller;
     this.Reference  = reference;
 }
 protected CommandExpression(CommandExpression left, CommandExpression right, ExpressionOperator expressionOperator)
 {
     _left     = left;
     _right    = right;
     _operator = expressionOperator;
 }
Ejemplo n.º 10
0
 public ICommandBuilder <IDictionary <string, object> > From(CommandExpression expression)
 {
     return(new CommandBuilder <IDictionary <string, object> >(expression));
 }
Ejemplo n.º 11
0
 public ResultCollection FindAll(CommandExpression expression)
 {
     return(Execute().ToEnumerable().ToObject <ResultCollection>(EnableDynamics));
 }
Ejemplo n.º 12
0
 public ResultRow FindOne(CommandExpression expression)
 {
     return(FindOne <ResultRow>());
 }
Ejemplo n.º 13
0
 public void Where(CommandExpression condition)
 {
     _whereExpression = condition;
 }