Пример #1
0
 protected override SqlBuilder Update(NewExpression expression, SqlBuilder sqlBuilder)
 {
     for (int i = 0; i < expression.Members.Count; i++)
     {
         MemberInfo         m = expression.Members[i];
         ConstantExpression c = expression.Arguments[i] as ConstantExpression;
         sqlBuilder += m.Name + " =";
         sqlBuilder.AddDbParameter(c.Value);
         sqlBuilder += ",";
     }
     if (sqlBuilder[sqlBuilder.Length - 1] == ',')
     {
         sqlBuilder.Remove(sqlBuilder.Length - 1, 1);
     }
     return(sqlBuilder);
 }
Пример #2
0
        protected override SqlBuilder In(NewArrayExpression expression, SqlBuilder sqlBuilder)
        {
            sqlBuilder += "(";

            foreach (Expression expressionItem in expression.Expressions)
            {
                Expression2SqlProvider.In(expressionItem, sqlBuilder);
            }

            if (sqlBuilder[sqlBuilder.Length - 1] == ',')
            {
                sqlBuilder.Remove(sqlBuilder.Length - 1, 1);
            }

            sqlBuilder += ")";

            return(sqlBuilder);
        }