Skip to content

Commit 7e6cb4c

Browse files
committed
Rely on default InvalidOperationException
When calling `Contract.Assume(bool)`, we now default to an `InvalidOperationException` (7548771). As such, we don't need to explicitly define this, and can rely on the non-generic method instead.
1 parent 6c01ec4 commit 7e6cb4c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

OnTopic.Data.Sql/SqlCommandExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ internal static class SqlCommandExtensions {
2929
/// <param name="command">The SQL command object.</param>
3030
/// <param name="sqlParameter">The name of the SQL parameter to retrieve as the return code.</param>
3131
internal static int GetReturnCode(this SqlCommand command, string sqlParameter = "ReturnCode") {
32-
Contract.Assume<InvalidOperationException>(
32+
Contract.Assume(
3333
command.Parameters.Contains($"@{sqlParameter}"),
3434
$"The call to the {command.CommandText} stored procedure did not return the expected 'ReturnCode' parameter."
3535
);

OnTopic.Data.Sql/SqlTopicRepository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ SqlDateTime version
437437

438438
topic.Id = command.GetReturnCode();
439439

440-
Contract.Assume<InvalidOperationException>(
440+
Contract.Assume(
441441
!topic.IsNew,
442442
"The call to the CreateTopic stored procedure did not return the expected 'Id' parameter."
443443
);

0 commit comments

Comments
 (0)