Skip to content

Commit df5999c

Browse files
committed
Replaced returnVal with topic.Id
As part of #9b5d01e, we assigned the `GetReturnCode()` directly to `topic.Id`. But we kept the (now) unused `returnVal`. This introduced a potential error, as the `Save()` procedure returns the `returnVal`. To fix this, the `returnVal` has now been removed, and `Save()` instead returns the `topic.Id`.
1 parent 7a27e31 commit df5999c

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

OnTopic.Data.Sql/SqlTopicRepository.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,6 @@ public override int Save([NotNull]Topic topic, bool isRecursive = false, bool is
727727
\-----------------------------------------------------------------------------------------------------------------------*/
728728
var connection = new SqlConnection(_connectionString);
729729
var command = (SqlCommand?)null;
730-
var returnVal = -1;
731730

732731
try {
733732

@@ -825,7 +824,7 @@ public override int Save([NotNull]Topic topic, bool isRecursive = false, bool is
825824
/*------------------------------------------------------------------------------------------------------------------------
826825
| Return value
827826
\-----------------------------------------------------------------------------------------------------------------------*/
828-
return returnVal;
827+
return topic.Id;
829828

830829
}
831830

0 commit comments

Comments
 (0)