protected static void ValidateBaseConfiguration(IDocumentDbAdapterConfiguration configuration)
        {
            Guard.NotNull("configuration", configuration);

            if (String.IsNullOrEmpty(configuration.ConnectionString))
            {
                throw Errors.ConnectionStringMissing();
            }
        }
        protected static DocumentDbClient CreateClient(IDocumentDbAdapterConfiguration configuration, IDataTransferContext context, bool isShardedImport, int?maxConnectionLimit)
        {
            Guard.NotNull("configuration", configuration);

            var connectionSettings = ParseConnectionString(configuration.ConnectionString);

            return(new DocumentDbClient(
                       CreateRawClient(connectionSettings, configuration.ConnectionMode, context, isShardedImport, maxConnectionLimit, configuration.Retries, configuration.RetryInterval),
                       connectionSettings.Database
                       ));
        }
Пример #3
0
        protected static DocumentDbClient CreateClient(IDocumentDbAdapterConfiguration configuration, IDataTransferContext context)
        {
            Guard.NotNull("configuration", configuration);

            var connectionSettings = ParseConnectionString(configuration.ConnectionString);

            return(new DocumentDbClient(
                       CreateRawClient(connectionSettings, configuration.ConnectionMode, context)
                       .AsReliable(new FixedInterval(
                                       null,
                                       GetValueOrDefault(configuration.Retries, Defaults.Current.NumberOfRetries, Errors.InvalidNumberOfRetries),
                                       GetValueOrDefault(configuration.RetryInterval, Defaults.Current.RetryInterval, Errors.InvalidRetryInterval),
                                       false)),
                       connectionSettings.Database
                       ));
        }