This could mean that the dev provides a diff callback for each type which returns a list of changes. But otherwise using it would look just like using EF normally. Here's what this might look like
public IEnumerable<IChange> Diff(Word? oldWord, Word newWord)
{
if (oldWord is null) return [new NewWordChange(newWord.Id, newWord.Text, newWord.Note)];
//etc...
}
public async Task CreateWord(Word word)
{
DbContext.Set<Word>().Add(word);
await DbContext.SaveChangesAsync();
}
we would just need to intercept the save event then call the Diff method defined by the user.
This could mean that the dev provides a diff callback for each type which returns a list of changes. But otherwise using it would look just like using EF normally. Here's what this might look like
we would just need to intercept the save event then call the Diff method defined by the user.