Skip to content

Commit 80bcdd7

Browse files
committed
Extend use of AddParameter() extension
Previously, `AddParameter()` wasn't used with either `PersistRelations()` (due to an oversight) or `DataTable` types (due to lack of support). With 0cd2506, the latter is now supported. This is now implemented across the board, providing more consistency in how we work with parameters.
1 parent 0cd2506 commit 80bcdd7

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

OnTopic.Data.Sql/SqlTopicRepository.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ SqlDateTime version
446446
}
447447
command.AddParameter("Version", version.Value);
448448
command.AddParameter("ExtendedAttributes", extendedAttributes);
449-
command.Parameters.AddWithValue("@Attributes", attributeValues);
449+
command.AddParameter("Attributes", attributeValues);
450450
command.AddOutputParameter();
451451

452452
/*------------------------------------------------------------------------------------------------------------------------
@@ -667,9 +667,9 @@ private static void PersistRelations(Topic topic, SqlConnection connection) {
667667
}
668668

669669
// Add Parameters
670-
command.Parameters.AddWithValue("TopicID", topicId);
671-
command.Parameters.AddWithValue("RelationshipKey", key);
672-
command.Parameters.AddWithValue("RelatedTopics", targetIds);
670+
command.AddParameter("TopicID", topicId);
671+
command.AddParameter("RelationshipKey", key);
672+
command.AddParameter("RelatedTopics", targetIds);
673673

674674
command.ExecuteNonQuery();
675675

0 commit comments

Comments
 (0)