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); }
protected override SqlPack Where(ConstantExpression expression, SqlPack sqlPack) { sqlPack.AddDbParameter(expression.Value); return(sqlPack); }