-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chore/fix sync bug multiple depedent changes (#16)
* create SetDefinitionPartOfSpeechChange, make a FK constraint between words and definitions * write a failing test due to how saving changes are ordered * Fix adding intermediate snapshots that reference new entities --------- Co-authored-by: Tim Haasdyk <[email protected]>
- Loading branch information
Showing
6 changed files
with
66 additions
and
9 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
src/SIL.Harmony.Sample/Changes/SetDefinitionPartOfSpeechChange.cs
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,16 @@ | ||
using SIL.Harmony.Changes; | ||
using SIL.Harmony.Entities; | ||
using SIL.Harmony.Sample.Models; | ||
|
||
namespace SIL.Harmony.Sample.Changes; | ||
|
||
public class SetDefinitionPartOfSpeechChange(Guid entityId, string partOfSpeech) : EditChange<Definition>(entityId), ISelfNamedType<SetDefinitionPartOfSpeechChange> | ||
{ | ||
public string PartOfSpeech { get; } = partOfSpeech; | ||
|
||
public override ValueTask ApplyChange(Definition entity, ChangeContext context) | ||
{ | ||
entity.PartOfSpeech = PartOfSpeech; | ||
return ValueTask.CompletedTask; | ||
} | ||
} |
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