Closed NormanGiHu closed 3 years ago
This is how i use the new extension methods to write history for added entries. Perhaps other people can use this too.
Usage Example:
var addedEntries = dbContext.ChangeTracker .Entries() .Where(e => e.State == EntityState.Added) .ToArray(); dbContext.EnsureAutoHistory(); dbContext.SaveChanges(); dbContext.EnsureAddedHistory(addedEntries); dbContext.SaveChanges();
thks
This is how i use the new extension methods to write history for added entries. Perhaps other people can use this too.
Usage Example:
var addedEntries = dbContext.ChangeTracker .Entries() .Where(e => e.State == EntityState.Added) .ToArray(); dbContext.EnsureAutoHistory(); dbContext.SaveChanges(); dbContext.EnsureAddedHistory(addedEntries); dbContext.SaveChanges();