Пример #1
0
        internal static string WithExpression <T>(params Expression <Func <T, object> >[] columnsAndValues)
        {
            var condition = columnsAndValues.Select(cvw => ExpressionHelper.ConditionBuilder(cvw)).ToList().Aggregate((c, n) => c + "," + n);

            return(string.Concat(Constants.Sql.Set, "(", condition, ")", " "));
        }
Пример #2
0
 internal static string BuildFunctionWithExpression <T>(string funcName, Expression <Func <T, object> > column, bool comma, bool parenthesis = true)
 {
     return(string.Concat(comma ? "," : "", funcName, parenthesis ? "(":"", ExpressionHelper.ConditionBuilder(column).Trim(' '), parenthesis ?")":"", " "));
 }
Пример #3
0
        internal static string WithExpression <T>(Expression <Func <T, object> > condition, bool parenthesis)
        {
            var value = ExpressionHelper.ConditionBuilder(condition, Constants.Sql.Or);

            return(!parenthesis ? value : string.Concat(value.Insert(Constants.Sql.Or.Length, "("), ")", " "));
        }
Пример #4
0
        internal static string WithExpression <T>(Expression <Func <T, object> > column, int startIndex, int length, bool comma)
        {
            var expression = ExpressionHelper.ConditionBuilder(column, Constants.Sql.SubString);

            return(string.Concat(comma ? "," : "", expression.Insert(Constants.Sql.SubString.Length, "("), ",", startIndex, ",", length, ")", " "));
        }