Esempio n. 1
0
        public DefaultRepository(IRoutingTable routes, HydratableGraveyard graveyard)
        {
            graveyard = graveyard ?? new HydratableGraveyard();
            this.catalog[graveyard.Key] = this.graveyard = graveyard;

            this.routes = routes;
        }
        public static HydratableGraveyard Restore(GraveyardMemento memento, HydratableGraveyard hydratable = null)
        {
            if (hydratable == null)
            {
                return(new HydratableGraveyard(memento));
            }

            hydratable.RestoreMemento(memento);
            return(hydratable);
        }
Esempio n. 3
0
        private IHydratable RestoreMemento <T>(string key, T memento)
        {
            var graveyardMemento = memento as GraveyardMemento;

            if (graveyardMemento != null)
            {
                return(HydratableGraveyard.Restore(graveyardMemento, this.graveyard));
            }

            return(this.routes.Restore(key, memento));
        }