-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Explicit archiving now can archive based on all edges or just start n…
…ode or both (#54) Co-authored-by: Farhad Nowzari <[email protected]>
- Loading branch information
1 parent
b923beb
commit 0daf2d0
Showing
8 changed files
with
136 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
namespace Neo4j.Berries.OGM.Models.General; | ||
|
||
internal class ArchiveOptions | ||
{ | ||
public bool StartNode { get; set; } | ||
public bool Edges { get; set; } | ||
} | ||
|
||
public class ArchiveOptionsBuilder | ||
{ | ||
internal ArchiveOptions Options { get; } = new ArchiveOptions(); | ||
/// <summary> | ||
/// If true, the matched node in the root query will be archived. | ||
/// </summary> | ||
public ArchiveOptionsBuilder StartNode() | ||
{ | ||
Options.StartNode = true; | ||
return this; | ||
} | ||
/// <summary> | ||
/// If true, the matched relation(s) in the result of WithRelation query will be archived. | ||
/// </summary> | ||
public ArchiveOptionsBuilder Edges() | ||
{ | ||
Options.Edges = true; | ||
return this; | ||
} | ||
/// <summary> | ||
/// Everything matched with queries prior to the archive method will be archived. | ||
/// </summary> | ||
public ArchiveOptionsBuilder All() | ||
{ | ||
Options.StartNode = true; | ||
Options.Edges = true; | ||
return this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters