public KeyValuePair <string, List <SugarParameter> > ToSql() { PreToSql(); string sql = UpdateBuilder.ToSqlString(); RestoreMapping(); return(new KeyValuePair <string, List <SugarParameter> >(sql, UpdateBuilder.Parameters)); }
public int ExecuteCommand() { PreToSql(); string sql = UpdateBuilder.ToSqlString(); RestoreMapping(); return(this.Ado.ExecuteCommand(sql, UpdateBuilder.Parameters == null ? null : UpdateBuilder.Parameters.ToArray())); }
public int ExecuteCommand() { PreToSql(); Check.Exception(UpdateBuilder.WhereValues.IsNullOrEmpty() && GetPrimaryKeys().IsNullOrEmpty(), "You cannot have no primary key and no conditions"); string sql = UpdateBuilder.ToSqlString(); RestoreMapping(); return(this.Ado.ExecuteCommand(sql, UpdateBuilder.Parameters == null ? null : UpdateBuilder.Parameters.ToArray())); }
private string _ExecuteCommand() { PreToSql(); AutoRemoveDataCache(); Check.Exception(UpdateBuilder.WhereValues.IsNullOrEmpty() && GetPrimaryKeys().IsNullOrEmpty(), "You cannot have no primary key and no conditions"); string sql = UpdateBuilder.ToSqlString(); ValidateVersion(); RestoreMapping(); Before(sql); return(sql); }
public virtual int ExecuteCommand() { PreToSql(); AutoRemoveDataCache(); Check.Exception(UpdateBuilder.WhereValues.IsNullOrEmpty() && GetPrimaryKeys().IsNullOrEmpty(), "You cannot have no primary key and no conditions"); string sql = UpdateBuilder.ToSqlString(); ValidateVersion(); RestoreMapping(); Before(sql); var result = this.Ado.ExecuteCommand(sql, UpdateBuilder.Parameters == null ? null : UpdateBuilder.Parameters.ToArray()); After(sql); return(result); }