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);
        }
Example #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();
        }
Example #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;
            };
        }
Example #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;
 }
Example #7
0
 public DomainRepository(IAggregateRootCreationStrategy aggregateRootCreationStrategy, IAggregateSnapshotter aggregateSnapshotter)
 {
     _aggregateRootCreator = aggregateRootCreationStrategy;
     _aggregateSnapshotter = aggregateSnapshotter;
 }
Example #8
0
 public DefaultAggregateSnapshotter(IAggregateRootCreationStrategy aggregateRootCreationStrategy, IAggregateSupportsSnapshotValidator snapshotValidator)
 {
     _aggregateRootCreator = aggregateRootCreationStrategy;
     _snapshotValidator    = snapshotValidator;
 }
Example #9
0
 public DomainRepository(IAggregateRootCreationStrategy aggregateRootCreationStrategy, IAggregateSnapshotter aggregateSnapshotter)
 {
     _aggregateRootCreator = aggregateRootCreationStrategy;
     _aggregateSnapshotter = aggregateSnapshotter;
 }
Example #10
0
 public RemoteFacade(IDomainRepository repository, IAggregateRootCreationStrategy factory)
 {
     _repository = repository;
     _factory = factory;
 }
 public MetaModelRepository(IEventStore store, IEventBus eventBus, ISnapshotStore snapshotStore = null, IAggregateRootCreationStrategy aggregateRootCreationStrategy = null)
     : base(new BranchableEventStoreAdapter(store), eventBus, snapshotStore, aggregateRootCreationStrategy)
 {
 }