@@ -392,7 +392,7 @@ SqlDateTime version
392392 /*------------------------------------------------------------------------------------------------------------------------
393393 | Establish database connection
394394 \-----------------------------------------------------------------------------------------------------------------------*/
395- var procedureName = ! topic . IsSaved ? "CreateTopic" : "UpdateTopic" ;
395+ var procedureName = topic . IsNew ? "CreateTopic" : "UpdateTopic" ;
396396
397397 using var command = new SqlCommand ( procedureName , connection ) {
398398 CommandType = CommandType . StoredProcedure
@@ -413,7 +413,7 @@ SqlDateTime version
413413 /*------------------------------------------------------------------------------------------------------------------------
414414 | Establish query parameters
415415 \-----------------------------------------------------------------------------------------------------------------------*/
416- if ( topic . IsSaved ) {
416+ if ( ! topic . IsNew ) {
417417 command . AddParameter ( "TopicID" , topic . Id ) ;
418418 command . AddParameter ( "DeleteRelationships" , areReferencesResolved && areRelationshipsDirty ) ;
419419 }
@@ -435,7 +435,7 @@ SqlDateTime version
435435 topic . Id = command . GetReturnCode ( ) ;
436436
437437 Contract . Assume < InvalidOperationException > (
438- topic . IsSaved ,
438+ ! topic . IsNew ,
439439 "The call to the CreateTopic stored procedure did not return the expected 'Id' parameter."
440440 ) ;
441441
@@ -605,7 +605,7 @@ private static void PersistRelations(Topic topic, SqlConnection connection) {
605605
606606 var relatedTopics = topic . Relationships . GetTopics ( key ) ;
607607 var topicId = topic . Id . ToString ( CultureInfo . InvariantCulture ) ;
608- var savedTopics = relatedTopics . Where ( t => t . IsSaved ) . Select < Topic , int > ( m => m . Id ) ;
608+ var savedTopics = relatedTopics . Where ( t => ! t . IsNew ) . Select < Topic , int > ( m => m . Id ) ;
609609
610610 using var targetIds = new TopicListDataTable ( ) ;
611611 using var command = new SqlCommand ( "UpdateRelationships" , connection ) {
0 commit comments