Пример #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SagaInstance{TData}"/> class.
        /// </summary>
        /// <param name="saga">The active <see cref="ISaga{TData}">saga</see>.</param>
        /// <param name="metadata">The associated <see cref="SagaMetadata">saga metadata</see>.</param>
        /// <param name="clock">The associated <see cref="IClock">clock</see>.</param>
        public SagaInstance(ISaga <TData> saga, SagaMetadata metadata, IClock clock)
        {
            Arg.NotNull(saga, nameof(saga));
            Arg.NotNull(metadata, nameof(metadata));
            Arg.NotNull(clock, nameof(clock));

            Instance = saga;
            Metadata = metadata;
            Modified = Created = clock.Now;
            Clock    = clock;
        }
Пример #2
0
 ISagaInstance ISagaInstanceActivator.Activate <TEvent>(IReceiveEvent <TEvent> eventReceiver, SagaMetadata metadata, IClock clock)
 {
     Contract.Requires <ArgumentNullException>(eventReceiver != null, nameof(eventReceiver));
     Contract.Requires <ArgumentNullException>(metadata != null, nameof(metadata));
     Contract.Requires <ArgumentNullException>(clock != null, nameof(clock));
     Contract.Ensures(Contract.Result <ISagaInstance>() != null);
     return(null);
 }
Пример #3
0
 ISagaInstance ISagaInstanceActivator.Activate <TCommand>(IHandleCommand <TCommand> commandHandler, SagaMetadata metadata, IClock clock)
 {
     Contract.Requires <ArgumentNullException>(commandHandler != null, nameof(commandHandler));
     Contract.Requires <ArgumentNullException>(metadata != null, nameof(metadata));
     Contract.Requires <ArgumentNullException>(clock != null, nameof(clock));
     Contract.Ensures(Contract.Result <ISagaInstance>() != null);
     return(null);
 }