예제 #1
0
        /// <inheritdoc/>
        public DefaultCosmosClientProvider(
            ICosmosClientOptionsProvider cosmosClientOptionsProvider,
            IOptions <RepositoryOptions> options)
        {
            _cosmosClientOptionsProvider = cosmosClientOptionsProvider
                                           ?? throw new ArgumentNullException(
                                                     nameof(cosmosClientOptionsProvider), "Cosmos Client Options Provider is required.");

            _options = options?.Value
                       ?? throw new ArgumentNullException(
                                 nameof(options), "Repository options are required.");

            _lazyCosmosClient = new Lazy <CosmosClient>(
                () => new CosmosClient(_options.CosmosConnectionString, _cosmosClientOptionsProvider.ClientOptions));
        }
 /// <inheritdoc/>
 public DefaultCosmosClientProvider(
     ICosmosClientOptionsProvider cosmosClientOptionsProvider,
     IOptions <RepositoryOptions> options) :