示例#1
0
        /// <summary>
        /// Calls <see cref="IAggregateFactory.Create"/> to get a, <typeparamref name="TSaga"/>.
        /// </summary>
        /// <typeparam name="TSaga">The <see cref="Type"/> of <see cref="ISaga{TAuthenticationToken}"/>.</typeparam>
        /// <param name="id">The id of the <typeparamref name="TSaga"/> to create.</param>
        protected virtual TSaga CreateSaga <TSaga>(Guid id)
            where TSaga : ISaga <TAuthenticationToken>
        {
            var saga = SagaFactory.Create <TSaga>(id);

            return(saga);
        }
示例#2
0
        /// <summary>
        /// Calls <see cref="IAggregateFactory.Create"/> to get a, <typeparamref name="TSaga"/> and then calls <see cref="LoadSagaHistory{TSaga}"/>.
        /// </summary>
        /// <typeparam name="TSaga">The <see cref="Type"/> of <see cref="ISaga{TAuthenticationToken}"/>.</typeparam>
        /// <param name="id">The id of the <typeparamref name="TSaga"/> to create.</param>
        /// <param name="events">
        /// A collection of <see cref="IEvent{TAuthenticationToken}"/> to replay on the retrieved <see cref="ISaga{TAuthenticationToken}"/>.
        /// If null, the <see cref="IEventStore{TAuthenticationToken}"/> will be used to retrieve a list of <see cref="IEvent{TAuthenticationToken}"/> for you.
        /// </param>
        protected virtual TSaga LoadSaga <TSaga>(Guid id, IList <ISagaEvent <TAuthenticationToken> > events = null)
            where TSaga : ISaga <TAuthenticationToken>
        {
            var saga = SagaFactory.Create <TSaga>(id);

            LoadSagaHistory(saga, events);
            return(saga);
        }
示例#3
0
        /// <summary>
        /// Calls <see cref="IAggregateFactory.Create"/> to get a, <typeparamref name="TSaga"/>.
        /// </summary>
        /// <typeparam name="TSaga">The <see cref="Type"/> of <see cref="ISaga{TAuthenticationToken}"/>.</typeparam>
        /// <param name="id">The id of the <typeparamref name="TSaga"/> to create.</param>
        protected override TSaga CreateSaga <TSaga>(Guid id)
        {
            var saga = SagaFactory.Create <TSaga>();

            return(saga);
        }