public DocumentDBRepository(ICosmosClient client, IDocumentClient docClient) { _client = client; _docClient = docClient; CreateDatabaseIfNotExistsAsync().Wait(); CreateCollectionIfNotExistsAsync().Wait(); }
public ActorRepositoryContainer( ICosmosClient cosmosClient, CosmosDatabaseConfig cosmosDatabaseConfig) { _cosmosClient = cosmosClient; _cosmosDatabaseConfig = cosmosDatabaseConfig; }
public static IServiceCollection AddCosmosStore <TEntity>(this IServiceCollection services, ICosmosClient cosmosClient, string databaseName, string overriddenCollectionName = "") where TEntity : class { services.AddSingleton <ICosmosStore <TEntity> >(x => new CosmosStore <TEntity>(cosmosClient, databaseName, overriddenCollectionName)); return(services); }
public CosmosStore(ICosmosClient cosmosClient, string databaseName, string overriddenCollectionName) : this(cosmosClient, databaseName, overriddenCollectionName, new CosmosDatabaseCreator(cosmosClient), new CosmosCollectionCreator(cosmosClient)) { }
public CosmosStore(CosmosStoreSettings settings, string overriddenCollectionName) { Settings = settings ?? throw new ArgumentNullException(nameof(settings)); DatabaseName = settings.DatabaseName; var documentClient = DocumentClientFactory.CreateDocumentClient(settings); CosmosClient = new CosmosClient(documentClient, Settings.InfiniteRetries); if (string.IsNullOrEmpty(Settings.DatabaseName)) { throw new ArgumentNullException(nameof(Settings.DatabaseName)); } _collectionCreator = new CosmosCollectionCreator(CosmosClient); _databaseCreator = new CosmosDatabaseCreator(CosmosClient); InitialiseCosmosStore(overriddenCollectionName); }
private CosmosStore(ICosmosClient cosmosClient, string databaseName, string overriddenCollectionName, IDatabaseCreator databaseCreator = null, ICollectionCreator collectionCreator = null) { DatabaseName = databaseName; CosmosClient = cosmosClient ?? throw new ArgumentNullException(nameof(cosmosClient)); Settings = new CosmosStoreSettings(databaseName, cosmosClient.DocumentClient.ServiceEndpoint.ToString(), string.Empty, cosmosClient.DocumentClient.ConnectionPolicy); if (Settings.InfiniteRetries) { CosmosClient.DocumentClient.SetupInfiniteRetries(); } if (string.IsNullOrEmpty(Settings.DatabaseName)) { throw new ArgumentNullException(nameof(Settings.DatabaseName)); } _collectionCreator = collectionCreator ?? new CosmosCollectionCreator(CosmosClient); _databaseCreator = databaseCreator ?? new CosmosDatabaseCreator(CosmosClient); InitialiseCosmosStore(overriddenCollectionName); }
public CosmosDatabaseCreator(IDocumentClient documentClient) { _cosmosClient = new CosmosClient(documentClient); }
public CosmosDatabaseCreator(ICosmosClient cosmosClient) { _cosmosClient = cosmosClient; }
public CosmosCollectionCreator(IDocumentClient documentClient) { _cosmosClient = new CosmosClient(documentClient); }
public CosmosCollectionCreator(ICosmosClient cosmosClient) { _cosmosClient = cosmosClient; }
public GetUrlHandler() { this.cosmosClient = new CosmosClient(); }
public DegradedHealthCheck(ICosmosClient cosmosClient) { _cosmosClient = cosmosClient; }
public DeleteUrlHandler() { this.cosmosClient = new CosmosClient(); }
public CosmosActivityDocumentRepository(ICosmosClient cosmosClient, ICosmosConfiguration config) { _cosmosClient = cosmosClient; _config = config; }
public CosmosStore(ICosmosClient cosmosClient, string databaseName) : this(cosmosClient, databaseName, string.Empty, new CosmosDatabaseCreator(cosmosClient), new CosmosCollectionCreator(cosmosClient)) { }