コード例 #1
0
        protected override SqlPack Update(NewExpression expression, SqlPack sqlPack)
        {
            for (var i = 0; i < expression.Members.Count; i++)
            {
                var m = expression.Members[i];
                var c = expression.Arguments[i] as ConstantExpression;
                sqlPack += m.Name + " =";
                sqlPack.AddDbParameter(c.Value);
                sqlPack += ",";
            }

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

            return(sqlPack);
        }
コード例 #2
0
 protected override SqlPack Where(ConstantExpression expression, SqlPack sqlPack)
 {
     sqlPack.AddDbParameter(expression.Value);
     return(sqlPack);
 }