public DocumentDbSagaRepository(
            IDocumentClient client,
            string databaseName,
            string collectionName,
            IDocumentDbSagaConsumeContextFactory documentDbSagaConsumeContextFactory,
            FeedOptions feedOptions,
            RequestOptions requestOptions)
        {
            if (string.IsNullOrWhiteSpace(collectionName))
            {
                throw new ArgumentNullException(nameof(collectionName));
            }

            if (collectionName.Length > 120)
            {
                throw new ArgumentException("Collection names must be no longer than 120 characters", nameof(collectionName));
            }

            _client = client;

            _databaseName   = databaseName;
            _collectionName = collectionName;
            _documentDbSagaConsumeContextFactory = documentDbSagaConsumeContextFactory ?? throw new ArgumentNullException(nameof(documentDbSagaConsumeContextFactory));

            _feedOptions    = feedOptions ?? new FeedOptions();
            _requestOptions = requestOptions ?? new RequestOptions();
        }
        public DocumentDbSagaRepository(
            IDocumentClient client,
            string databaseName,
            string collectionName,
            IDocumentDbSagaConsumeContextFactory documentDbSagaConsumeContextFactory,
            JsonSerializerSettings jsonSerializerSettings)
        {
            if (string.IsNullOrWhiteSpace(collectionName))
            {
                throw new ArgumentNullException(nameof(collectionName));
            }

            if (collectionName.Length > 120)
            {
                throw new ArgumentException("Collection names must be no longer than 120 characters", nameof(collectionName));
            }

            _client = client;

            _databaseName   = databaseName;
            _collectionName = collectionName;
            _documentDbSagaConsumeContextFactory = documentDbSagaConsumeContextFactory ?? throw new ArgumentNullException(nameof(documentDbSagaConsumeContextFactory));

            _jsonSerializerSettings = jsonSerializerSettings;
            if (_jsonSerializerSettings != null)
            {
                _feedOptions = new FeedOptions {
                    JsonSerializerSettings = _jsonSerializerSettings
                };
                _requestOptions = new RequestOptions {
                    JsonSerializerSettings = _jsonSerializerSettings
                };
            }
        }
Пример #3
0
 public MissingPipe(IDocumentClient client, string databaseName, string collectionName, IPipe <SagaConsumeContext <TSaga, TMessage> > next,
                    IDocumentDbSagaConsumeContextFactory documentDbSagaConsumeContextFactory)
 {
     _client         = client;
     _databaseName   = databaseName;
     _collectionName = collectionName;
     _next           = next;
     _documentDbSagaConsumeContextFactory = documentDbSagaConsumeContextFactory;
 }
Пример #4
0
 public DocumentDbSagaRepository(IDocumentClient client,
                                 string databaseName,
                                 string collectionName,
                                 IDocumentDbSagaConsumeContextFactory documentDbSagaConsumeContextFactory,
                                 JsonSerializerSettings jsonSerializerSettings)
     : this(client, databaseName, collectionName, documentDbSagaConsumeContextFactory, null, null)
 {
     if (jsonSerializerSettings != null)
     {
         _jsonSerializerSettings = jsonSerializerSettings;
         _requestOptions.JsonSerializerSettings = jsonSerializerSettings;
         _feedOptions.JsonSerializerSettings    = jsonSerializerSettings;
     }
 }
Пример #5
0
 public MissingPipe(IDocumentClient client, string databaseName, string collectionName, IPipe <SagaConsumeContext <TSaga, TMessage> > next,
                    IDocumentDbSagaConsumeContextFactory documentDbSagaConsumeContextFactory, JsonSerializerSettings jsonSerializerSettings)
 {
     _client         = client;
     _databaseName   = databaseName;
     _collectionName = collectionName;
     _next           = next;
     _documentDbSagaConsumeContextFactory = documentDbSagaConsumeContextFactory;
     _jsonSerializerSettings = jsonSerializerSettings;
     if (_jsonSerializerSettings != null)
     {
         _requestOptions = new RequestOptions {
             JsonSerializerSettings = jsonSerializerSettings
         }
     }
     ;
 }
 public DocumentDbSagaRepository(IDocumentClient client, string databaseName, IDocumentDbSagaConsumeContextFactory documentDbSagaConsumeContextFactory)
     : this(client, databaseName, DefaultCollectionName, documentDbSagaConsumeContextFactory, null, null)
 {
 }