Exemplo n.º 1
0
        /// <summary>
        /// Constructs the saga storage, using the specified connection provider and tables for persistence.
        /// </summary>
        public SqlServerSagaStorage(IDbConnectionProvider connectionProvider, string dataTableName, string indexTableName, IRebusLoggerFactory rebusLoggerFactory, ISagaTypeNamingStrategy sagaTypeNamingStrategy)
        {
            if (connectionProvider == null)
            {
                throw new ArgumentNullException(nameof(connectionProvider));
            }
            if (dataTableName == null)
            {
                throw new ArgumentNullException(nameof(dataTableName));
            }
            if (indexTableName == null)
            {
                throw new ArgumentNullException(nameof(indexTableName));
            }
            if (rebusLoggerFactory == null)
            {
                throw new ArgumentNullException(nameof(rebusLoggerFactory));
            }
            if (sagaTypeNamingStrategy == null)
            {
                throw new ArgumentNullException(nameof(sagaTypeNamingStrategy));
            }

            _log = rebusLoggerFactory.GetLogger <SqlServerSagaStorage>();
            _connectionProvider     = connectionProvider;
            _sagaTypeNamingStrategy = sagaTypeNamingStrategy;
            _dataTableName          = TableName.Parse(dataTableName);
            _indexTableName         = TableName.Parse(indexTableName);
        }
 /// <summary>
 /// Constructs a new instance which will defer actual naming to <paramref name="innerSagaTypeNamingStrategy"/>
 /// </summary>
 public CachedSagaTypeNamingStrategy(ISagaTypeNamingStrategy innerSagaTypeNamingStrategy)
 {
     _innerSagaTypeNamingStrategy = innerSagaTypeNamingStrategy;
 }