public async Task Execute(IEnumerable <CommitContext> context, Next <IEnumerable <CommitContext> > next)
        {
            bool AddOrRemove(CommitContext commitContext) => commitContext.ActionType != ActionType.Update;

            bool UpdateHasChanges(CommitContext commitContext) => commitContext.ActionType == ActionType.Update &&
            _tracking.HasChanges(commitContext.Entity);

            var toCommit = context
                           .Where(x => AddOrRemove(x) || UpdateHasChanges(x)).ToList();


            await next(toCommit);


            foreach (var item in toCommit)
            {
                switch (item.ActionType)
                {
                case ActionType.Add:
                    _tracking.TrackInstance(item.Entity);
                    break;

                case ActionType.Update:
                    _tracking.Reset(item.Entity);
                    break;

                case ActionType.Delete:
                    _tracking.CeaseTracking(item.Entity);
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }
            }
        }