예제 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UnitOfWork" /> class.
 /// </summary>
 /// <param name="provider">The provider.</param>
 /// <param name="loader">The loader.</param>
 /// <param name="aggregateEventContext">The aggregate event context.</param>
 /// <param name="workContext">The context.</param>
 /// <param name="queueSender">The queue sender.</param>
 public UnitOfWork(
     IPersistenceProvider provider,
     IAggregateLoader loader,
     IAggregateEventContext aggregateEventContext,
     IUnitOfWorkContext workContext,
     IUnitOfWorkQueueSender queueSender)
 {
     this.provider = Check.NotNull(() => provider);
     this.loader   = Check.NotNull(() => loader);
     this.aggregateEventContext = Check.NotNull(() => aggregateEventContext);
     this.workContext           = Check.NotNull(() => workContext);
     this.queueSender           = Check.NotNull(() => queueSender);
     this.Clean();
 }
예제 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AsyncDispatcherCall" /> class.
        /// </summary>
        /// <param name="asyncListeners">The asynchronous listeners.</param>
        /// <param name="work">The work.</param>
        /// <param name="eventContext">The event context.</param>
        /// <param name="snapShoter">The snap shoter.</param>
        /// <param name="log">The log.</param>
        public AsyncDispatcherCall(
            IEnumerable <IAsyncListener> asyncListeners,
            IUnitOfWork work,
            IAggregateEventContext eventContext,
            IAggregateSnapShoter snapShoter,
            ILogger log)
        {
            this.asyncListeners = Check.NotNull(() => asyncListeners)
                                  .GroupBy(x => x.GetType())
                                  .Select(group => group.First());

            this.work         = Check.NotNull(() => work);;
            this.eventContext = Check.NotNull(() => eventContext);;
            this.snapShoter   = Check.NotNull(() => snapShoter);;
            this.log          = Check.NotNull(() => log);;
        }