@@ -710,7 +710,7 @@ public async Task<IActionResult> Import(IFormFile jsonFile, [Bind(Prefix = "Impo
710710 /*------------------------------------------------------------------------------------------------------------------------
711711 | INDEX TOPICS IN SCOPE
712712 \-----------------------------------------------------------------------------------------------------------------------*/
713- var topics = target . FindAll ( t => t . Id >= 0 ) . ToList ( ) ;
713+ var topics = target . FindAll ( t => ! t . IsNew ) . ToList ( ) ;
714714
715715 /*------------------------------------------------------------------------------------------------------------------------
716716 | INITIAL IMPORT
@@ -725,7 +725,7 @@ public async Task<IActionResult> Import(IFormFile jsonFile, [Bind(Prefix = "Impo
725725 | removed topics during a recursive save and, therefore, the deletions aren't persited to the database. To mitigate this,
726726 | we evaluate the topic graph after the save, and then delete any orphans.
727727 \-----------------------------------------------------------------------------------------------------------------------*/
728- var unmatchedTopics = topics . Except ( target . FindAll ( t => t . Id >= 0 ) ) ;
728+ var unmatchedTopics = topics . Except ( target . FindAll ( t => ! t . IsNew ) ) ;
729729
730730 foreach ( var unmatchedTopic in unmatchedTopics ) {
731731 TopicRepository . Delete ( unmatchedTopic ) ;
@@ -739,7 +739,7 @@ public async Task<IActionResult> Import(IFormFile jsonFile, [Bind(Prefix = "Impo
739739 | Otherwise, Save() will generate an error since the parent ID won't be found.
740740 \-----------------------------------------------------------------------------------------------------------------------*/
741741 var saveRoot = target ;
742- if ( target . Parent . Id < 0 ) {
742+ if ( target . Parent . IsNew ) {
743743 saveRoot = target . Parent ;
744744 }
745745
0 commit comments