Refactor all usages of SqlHelper, ExecuteReader and ExecuteXmlReader into using blocks

This commit is contained in:
Sebastiaan Janssen
2016-11-25 22:18:35 +01:00
parent 47c8e6854e
commit ee3a4614c3
78 changed files with 2143 additions and 1684 deletions

View File

@@ -229,15 +229,16 @@ namespace umbraco.editorControls.PickerRelations
getRelationsSql += " AND comment = '" + instanceIdentifier + "'";
using (IRecordsReader relations = uQuery.SqlHelper.ExecuteReader(getRelationsSql))
using (var sqlHelper = Application.SqlHelper)
using (IRecordsReader relations = sqlHelper.ExecuteReader(getRelationsSql))
{
//clear data
Relation relation;
while (relations.Read())
while (relations.Read())
{
relation = new Relation(relations.GetInt("id"));
relation = new Relation(relations.GetInt("id"));
// TODO: [HR] check to see if an instance identifier is used
// TODO: [HR] check to see if an instance identifier is used
relation.Delete();
}
}