Skip to content

Commit c84b69d

Browse files
committed
Simplified assignment
As part of #ac6c2ba, I simplified how the `procedureName` was assigned to the `SqlCommand` object. That allows the assignment of the `CommandType` to be even further simplified by using the inline property initializers.
1 parent df5999c commit c84b69d

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

OnTopic.Data.Sql/SqlTopicRepository.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -739,8 +739,9 @@ public override int Save([NotNull]Topic topic, bool isRecursive = false, bool is
739739
| Establish command type (insert or update)
740740
\---------------------------------------------------------------------------------------------------------------------*/
741741
var procedureName = topic.Id > 0? "CreateTopic" : "UpdateTopic";
742-
command = new SqlCommand(procedureName, connection);
743-
command.CommandType = CommandType.StoredProcedure;
742+
command = new SqlCommand(procedureName, connection) {
743+
CommandType = CommandType.StoredProcedure
744+
};
744745

745746
/*----------------------------------------------------------------------------------------------------------------------
746747
| SET VERSION DATETIME

0 commit comments

Comments
 (0)