Skip to content

Commit 79f64c1

Browse files
committed
Introduce a new DeleteUnmatchedReferences option
We have `DeleteUnmatched` options for `Attributes`, `Relationships`, `NestedTopics`, and `Children`. Now, with the introduction of `References`, we need a corresponding `DeleteUnmatchedReferences`, to extend that capability.
1 parent bc45dc8 commit 79f64c1

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

OnTopic.Data.Transfer/Interchange/ImportOptions.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public class ImportOptions {
2828
\-------------------------------------------------------------------------------------------------------------------------*/
2929
private bool? _deleteUnmatchedAttributes;
3030
private bool? _deleteUnmatchedRelationships;
31+
private bool? _deleteUnmatchedReferences;
3132
private bool? _deleteUnmatchedChildren;
3233
private bool? _deleteUnmatchedNestedTopics;
3334
private bool? _overwriteContentType;
@@ -77,6 +78,21 @@ public bool DeleteUnmatchedRelationships {
7778
set => _deleteUnmatchedRelationships = value;
7879
}
7980

81+
/*==========================================================================================================================
82+
| DELETE UNMATCHED REFERENCES
83+
\-------------------------------------------------------------------------------------------------------------------------*/
84+
/// <summary>
85+
/// Delete references in the target database which don't exist in the source <see cref="TopicData"/> graph.
86+
/// </summary>
87+
/// <remarks>
88+
/// This will delete any existing references that aren't <i>also</i> represented in the source <see cref="TopicData"/>
89+
/// graph.
90+
/// </remarks>
91+
public bool DeleteUnmatchedReferences {
92+
get => _deleteUnmatchedReferences?? Strategy is ImportStrategy.Replace;
93+
set => _deleteUnmatchedReferences = value;
94+
}
95+
8096
/*==========================================================================================================================
8197
| DELETE UNMATCHED CHILDREN
8298
\-------------------------------------------------------------------------------------------------------------------------*/

0 commit comments

Comments
 (0)