Пример #1
0
        public static ModelChanged <T> CaptureChangedEvent <T>(this T model, Action <T> modelAction) where T : Aggregate
        {
            var tracker = new PropertiesTracker <T>(model);

            tracker.SaveSnapshot();

            modelAction(model);

            var comparisionResult = tracker.CompareWithCurrentState();
            var changedEvent      = new ModelChanged <T>(comparisionResult.PropertiesChanged);

            return(changedEvent);
        }
Пример #2
0
 public ModelChangesPublisher(T model)
 {
     _propertiesTracker = new PropertiesTracker <T>(model);
     _propertiesTracker.SaveSnapshot();
 }