/// <summary>
        ///     <para>
        ///         Adds the necessary services to enable the <see cref="OutboxProduceStrategy" />.
        ///     </para>
        ///     <para>
        ///         The <see cref="OutboxProduceStrategy" /> stores the outbound messages into an intermediate outbox,
        ///         participating in the database transaction. The outbound messages become therefore transactional
        ///         with the side effects on the local database.
        ///     </para>
        /// </summary>
        /// <typeparam name="TOutbox">
        ///     The type implementing both the <see cref="IOutboxWriter" /> and the <see cref="IOutboxReader" />
        ///     interfaces.
        /// </typeparam>
        /// <param name="brokerOptionsBuilder">
        ///     The <see cref="IBrokerOptionsBuilder" /> that references the <see cref="IServiceCollection" /> to
        ///     add the services to.
        /// </param>
        /// <returns>
        ///     The <see cref="IBrokerOptionsBuilder" /> so that additional calls can be chained.
        /// </returns>
        public static IBrokerOptionsBuilder AddOutbox <TOutbox>(this IBrokerOptionsBuilder brokerOptionsBuilder)
            where TOutbox : class, IOutboxWriter, IOutboxReader
        {
            Check.NotNull(brokerOptionsBuilder, nameof(brokerOptionsBuilder));

            return(brokerOptionsBuilder.AddOutbox <TOutbox, TOutbox>());
        }
        /// <summary>
        ///     <para>
        ///         Adds the necessary services to enable the <see cref="OutboxProduceStrategy" /> using a database
        ///         table as outbox.
        ///     </para>
        ///     <para>
        ///         The <see cref="OutboxProduceStrategy" /> stores the outbound messages into an intermediate outbox,
        ///         participating in the database transaction. The outbound messages become therefore transactional
        ///         with the side effects on the local database.
        ///     </para>
        /// </summary>
        /// <param name="brokerOptionsBuilder">
        ///     The <see cref="IBrokerOptionsBuilder" /> that references the <see cref="IServiceCollection" /> to
        ///     add the services to.
        /// </param>
        /// <returns>
        ///     The <see cref="IBrokerOptionsBuilder" /> so that additional calls can be chained.
        /// </returns>
        public static IBrokerOptionsBuilder AddOutboxDatabaseTable(this IBrokerOptionsBuilder brokerOptionsBuilder)
        {
            Check.NotNull(brokerOptionsBuilder, nameof(brokerOptionsBuilder));

            return(brokerOptionsBuilder.AddOutbox <DbOutboxWriter, DbOutboxReader>());
        }