public DocumentDbRepository(IDocumentDbConfigurationOptions configuration) { var resources = DocumentDbResources.CreateResources(configuration); Client = resources.DocumentClient; DocumentCollection = resources.DocumentCollection; }
public DocumentDbRepository(string cosmosDatabase, IDocumentDbConfiguration configuration) { var resources = DocumentDbResources.CreateResources(configuration, typeof(T).Name); Client = resources.DocumentClient; DocumentCollection = resources.DocumentCollection; }
public DocumentDbRepository(IDocumentDbConfiguration configuration) { var resources = DocumentDbResources.CreateResources(configuration, typeof(T).Name); Client = resources.DocumentClient; DocumentCollection = resources.DocumentCollection; database = configuration.DatabaseName; }
public static async Task <IAsyncRepository <T> > Create(Uri documentDb, string key, string databaseName, string documentCollection, CancellationToken token) { var configuration = new DocumentDbConfigurationOptions { DatabaseName = databaseName, CollectionName = documentCollection, Key = key, DocumentDb = documentDb }; var resources = await DocumentDbResources.CreateResourcesAsync(configuration, token); return(new DocumentDbRepository <T>(resources.DocumentClient, resources.DocumentCollection)); }