예제 #1
0
        /// <summary>
        /// Seed
        /// </summary>
        /// <returns></returns>
        public async Task TearDown()
        {
            _logger.LogInformation("Tearing Down Database...");

            var connectionSettings = new LocationConnectionSettings(
                new Uri(_settings.Value.URL),
                _settings.Value.PrimaryKey,
                _settings.Value.DatabaseId);

            var client = _service.CreateClient(connectionSettings, false);

            try
            {
                await client.DeleteDatabaseAsync($"dbs/{_settings.Value.DatabaseId}");
            }
            catch (DocumentClientException documentClientException)
            {
                _logger.LogError(documentClientException.Message);
                _logger.LogError(documentClientException.StackTrace);
            }

            _logger.LogInformation($" Torn down.");
        }
예제 #2
0
 private IDocumentClient GetClient(IClientSettings connectionSettings)
 {
     return(_documentClientFactory.CreateClient(connectionSettings, _bypassSsl));
 }