protected override void Given()
        {
            base.Given();
            var settings = new NinjectSettings {InjectNonPublic = true};

            IKernel kernel = new StandardKernel(settings);
            kernel.Bind<IClock>().To<DateTimeBasedClock>();
            _creationStrategy = new NinjectAggregateRootCreationStrategy(kernel);
        }
Esempio n. 2
0
        public DomainRepository(IEventStore store, IEventBus eventBus, ISnapshotStore snapshotStore = null, IAggregateRootCreationStrategy aggregateRootCreationStrategy = null)
        {
            Contract.Requires <ArgumentNullException>(store != null);
            Contract.Requires <ArgumentNullException>(eventBus != null);

            _store                = store;
            _eventBus             = eventBus;
            _snapshotStore        = snapshotStore;
            _aggregateRootCreator = aggregateRootCreationStrategy ?? new SimpleAggregateRootCreationStrategy();
        }
Esempio n. 3
0
        protected override void Given()
        {
            base.Given();
            var settings = new NinjectSettings {
                InjectNonPublic = true
            };

            IKernel kernel = new StandardKernel(settings);

            kernel.Bind <IClock>().To <DateTimeBasedClock>();
            _creationStrategy = new NinjectAggregateRootCreationStrategy(kernel);
        }
        public AggregateDynamicSnapshotter(IAggregateRootCreationStrategy aggregateRootCreationStrategy, IAggregateSupportsSnapshotValidator snapshotValidator)
        {
            _aggregateRootCreator = aggregateRootCreationStrategy;
            _snapshotValidator = snapshotValidator;

            AppDomain.CurrentDomain.AssemblyResolve += (sender, eventArgs) =>
            {
                if (eventArgs.Name.Contains("DynamicSnapshot"))
                    return Assembly.LoadFrom("DynamicSnapshot.dll");
                return null;
            };
        }
Esempio n. 5
0
        public AggregateDynamicSnapshotter(IAggregateRootCreationStrategy aggregateRootCreationStrategy, IAggregateSupportsSnapshotValidator snapshotValidator)
        {
            _aggregateRootCreator = aggregateRootCreationStrategy;
            _snapshotValidator    = snapshotValidator;

            AppDomain.CurrentDomain.AssemblyResolve += (sender, eventArgs) =>
            {
                if (eventArgs.Name.Contains("DynamicSnapshot"))
                {
                    return(Assembly.LoadFrom("DynamicSnapshot.dll"));
                }
                return(null);
            };
        }
 public DefaultAggregateSnapshotter(IAggregateRootCreationStrategy aggregateRootCreationStrategy, IAggregateSupportsSnapshotValidator snapshotValidator)
 {
     _aggregateRootCreator = aggregateRootCreationStrategy;
     _snapshotValidator = snapshotValidator;
 }
Esempio n. 7
0
 public DomainRepository(IAggregateRootCreationStrategy aggregateRootCreationStrategy, IAggregateSnapshotter aggregateSnapshotter)
 {
     _aggregateRootCreator = aggregateRootCreationStrategy;
     _aggregateSnapshotter = aggregateSnapshotter;
 }
Esempio n. 8
0
 public DefaultAggregateSnapshotter(IAggregateRootCreationStrategy aggregateRootCreationStrategy, IAggregateSupportsSnapshotValidator snapshotValidator)
 {
     _aggregateRootCreator = aggregateRootCreationStrategy;
     _snapshotValidator    = snapshotValidator;
 }
Esempio n. 9
0
 public DomainRepository(IAggregateRootCreationStrategy aggregateRootCreationStrategy, IAggregateSnapshotter aggregateSnapshotter)
 {
     _aggregateRootCreator = aggregateRootCreationStrategy;
     _aggregateSnapshotter = aggregateSnapshotter;
 }
Esempio n. 10
0
 public RemoteFacade(IDomainRepository repository, IAggregateRootCreationStrategy factory)
 {
     _repository = repository;
     _factory = factory;
 }
Esempio n. 11
0
 public MetaModelRepository(IEventStore store, IEventBus eventBus, ISnapshotStore snapshotStore = null, IAggregateRootCreationStrategy aggregateRootCreationStrategy = null)
     : base(new BranchableEventStoreAdapter(store), eventBus, snapshotStore, aggregateRootCreationStrategy)
 {
 }