Пример #1
0
        public void ApplyTo(TrackablePocoTracker <T> tracker)
        {
            if (tracker == null)
            {
                throw new ArgumentNullException(nameof(tracker));
            }

            foreach (var item in ChangeMap)
            {
                tracker.TrackSet(item.Key, item.Value.OldValue, item.Value.NewValue);
            }
        }
Пример #2
0
        public void RollbackTo(TrackablePocoTracker <T> tracker)
        {
            if (tracker == null)
            {
                throw new ArgumentNullException(nameof(tracker));
            }

            if (this == tracker)
            {
                ChangeMap.Clear();
            }
            else
            {
                foreach (var item in ChangeMap)
                {
                    tracker.TrackSet(item.Key, item.Value.NewValue, item.Value.OldValue);
                }
            }
        }