Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recording added entities does not work #71

Open
rufer7 opened this issue Dec 21, 2021 · 1 comment
Open

Recording added entities does not work #71

rufer7 opened this issue Dec 21, 2021 · 1 comment

Comments

@rufer7
Copy link

rufer7 commented Dec 21, 2021

I tried to enable recording of added entities as described in the README. Unfortunately it's not working.
In the code of AutoHistory there is an extension method called AddedHistory which seems to do the trick but this method is not called at all in the class DbContextExtensions

EF Core version: 5.0.11
AutoHistory version: 5.0.8

Introduced by https://github.com/Arch/AutoHistory/pull/61/files

@rufer7 rufer7 changed the title Seems like recording added entities does not work Recording added entities does not work Dec 21, 2021
@ErikBarriga
Copy link

I think this issue can be quickly resolved with the next change:
On the "DbContextExtensions.cs" (AutoHistory/src/Microsoft.EntityFrameworkCore.AutoHistory/Extensions/) When the function "EnsureAutoHistory" (public static void EnsureAutoHistory(this DbContext context, Func createHistoryFactory)) is executed, every entry runs "entry.AutoHistory(createHistoryFactory)" but they should be "entry.AddedHistory(createHistoryFactory)"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants