private void DateDiff(MethodCallExpression method, StringBuilder sb, IGenerateSqlFromExpressions writer)
 {
     sb.Append("datediff(");
     sb.Append(method.Arguments[1].GetValue().ToString()).Append(",");
     sb.Append(writer.GetColumnsSql(method.Arguments[2])).Append(",");
     sb.Append(writer.GetColumnsSql(method.Arguments[3]));
     sb.Append(")");
 }
Beispiel #2
0
 private void Round(MethodCallExpression method, StringBuilder sb, IGenerateSqlFromExpressions writer)
 {
     sb.Append("round(");
     sb.Append(writer.GetColumnsSql(method.Arguments[1]));
     sb.Append(",");
     sb.Append(writer.GetSql(method.Arguments[2]));
     sb.Append(")");
 }
Beispiel #3
0
 private void MyConcat(MethodCallExpression method, StringBuilder sb, IGenerateSqlFromExpressions writer)
 {
     foreach (var arg in method.Arguments[1].CastAs <NewArrayExpression>().Expressions)
     {
         sb.Append(writer.GetColumnsSql(arg));
         sb.Append(" || ");
     }
     sb.RemoveLastIfEquals("|| ");
 }
Beispiel #4
0
 public IGenerateSql <TProj> Select <TProj>(Expression <Func <T, TProj> > selector, bool distinct = false)
 => Select <TProj>(_writer.GetColumnsSql(selector), distinct);
Beispiel #5
0
 private void Max(MethodCallExpression method, StringBuilder sb, IGenerateSqlFromExpressions manager)
 => sb.Append($"max({manager.GetColumnsSql(method.Arguments[1])})");
Beispiel #6
0
 private void Sum(MethodCallExpression method, StringBuilder sb, IGenerateSqlFromExpressions w)
 => sb.Append($"sum({w.GetColumnsSql(method.Arguments[1])})");
        public IBuildUpdateTable <T> Set(Expression <Func <T, object> > column, Expression <Func <T, object> > statement)
        {
            _sb.Append($"{_writer.GetColumnsSql(column)}={_writer.GetColumnsSql(statement)},");

            return(this);
        }
Beispiel #8
0
        private void BetweenDates(MethodCallExpression arg1, StringBuilder sb, IGenerateSqlFromExpressions writer)
        {
            var date = writer.GetColumnsSql(arg1.Arguments[0]);

            sb.Append($"{date}>={writer.GetSql(arg1.Arguments[1])} and {date}<={writer.GetSql(arg1.Arguments[2])}");
        }