Beispiel #1
0
 public void MergeOn(Constructor.dbCom comp, Expression keyDestiny, params Expression[] keyOrigin)
 {
     Constructor.Comparison whr = new Constructor.Comparison();
     whr.comparator = keyDestiny.ToString();
     whr.type       = comp;
     whr.values     = new List <string>();
     foreach (Expression val in keyOrigin)
     {
         whr.values.Add(val.ToString());
     }
     Keys.Add(whr);
 }
Beispiel #2
0
        /// <summary>Agrega una condicion a una estructura de control case</summary>
        public Expression When(Expression then, Constructor.dbCom comp, Expression cond, params Expression[] values)
        {
            Comparison whr = new Comparison();

            if (cond.IsComplex)
            {
                whr.expr = cond;
            }
            whr.comparator = cond.ToString();
            whr.type       = comp;
            whr.values     = values.Select(v => v.ToString()).ToList();

            return(this.Operate(whr, then));
        }
Beispiel #3
0
        /// <summary>Inicia una estructura de control de flujo case</summary>
        private static Expression CaseWhen(Expression then, bool isRoot, Constructor.dbCom comp, Expression cond, params Expression[] values)
        {
            Comparison whr = new Comparison();

            if (cond.IsComplex)
            {
                whr.expr = cond;
            }
            whr.comparator = cond.ToString();
            whr.type       = comp;
            whr.values     = values.Select(v => v.ToString()).ToList();

            return(new Expression(whr, then, isRoot));
        }
Beispiel #4
0
        /// <summary>Adds a condition to the merge action</summary>
        public Query MergeWhen(Constructor.dbCom comp, Expression comparator, params Expression[] values)
        {
            Comparison whr = new Comparison();

            whr.comparator = comparator.ToString();
            whr.type       = comp;
            whr.values     = new List <string>();
            foreach (Expression val in values)
            {
                whr.values.Add(val.ToString());
            }
            merge.MergeWhen(whr);
            return(this);
        }
Beispiel #5
0
 /// <summary>Inicia una estructura de control de flujo case</summary>
 public static Expression CaseWhen(Expression then, Constructor.dbCom comp, Expression cond, params Expression[] values)
 {
     return(CaseWhen(then, true, comp, cond, values));
 }
Beispiel #6
0
 /// <summary>Agrega una condición de union para el origen y el destino de la consulta merge</summary>
 public Query MergeOn(Constructor.dbCom comp, Expression keyDestiny, Expression keyOrigin)
 {
     merge.MergeOn(comp, keyDestiny, keyOrigin);
     return(this);
 }