Exemplo n.º 1
0
        public override async Task <int> SaveChangesAsync(CancellationToken cancellationToken = new CancellationToken())
        {
            Action updateEntityChanges = () => { };
            var    entries             = ChangeTracker.Entries();

            foreach (var entry in entries)
            {
                var state = entry.State;
                updateEntityChanges += () => _testContext.AddEntityChange(entry.Entity, state);
            }

            var result = await base.SaveChangesAsync(cancellationToken);

            updateEntityChanges();
            return(result);
        }