示例#1
0
        private static IStoreEvents BuildEventStore(NanoContainer context)
        {
            var scopeOption = context.Resolve <TransactionScopeOption>();
            OptimisticPipelineHook concurrency = scopeOption == TransactionScopeOption.Suppress ? new OptimisticPipelineHook() : null;
            var scheduler   = new DispatchSchedulerPipelineHook(context.Resolve <IScheduleDispatches>());
            var upconverter = context.Resolve <EventUpconverterPipelineHook>();

            ICollection <IPipelineHook> hooks = context.Resolve <ICollection <IPipelineHook> >() ?? new IPipelineHook[0];

            hooks = new IPipelineHook[] { concurrency, scheduler, upconverter }
            .Concat(hooks)
            .Where(x => x != null)
            .ToArray();

            return(new OptimisticEventStore(context.Resolve <IPersistStreams>(), hooks));
        }
 protected override void Context()
 {
     _dispatchSchedulerHook = new DispatchSchedulerPipelineHook(_dispatcher);
 }
 protected override void Context()
 {
     _dispatchSchedulerHook = new DispatchSchedulerPipelineHook(_dispatcher);
 }
 protected override void Context()
 {
     DispatchSchedulerHook = new DispatchSchedulerPipelineHook(dispatcher.Object);
     dispatcher.Setup(x => x.ScheduleDispatch(null));
 }
 protected override void Context()
 {
     DispatchSchedulerHook = new DispatchSchedulerPipelineHook(dispatcher.Object);
     dispatcher.Setup(x => x.ScheduleDispatch(null));
 }