public DocumentCollectionContext(DocumentClient client, CosmosDbClientConfig config)
        {
            _client = client;
            _config = config;

            CreateContextIfNotExists();
        }
Пример #2
0
 public static DocumentClient CreateClient(CosmosDbClientConfig config)
 {
     return(new DocumentClient(
                new Uri(config.endPointUrl),
                config.authKey,
                config.GetConnectionPolicy()
                ));
 }
Пример #3
0
        public static DocumentCollectionContext CreateCollectionContext(CosmosDbClientConfig config)
        {
            DocumentCollectionContext context = new DocumentCollectionContext(
                client: CosmosDBFactory.CreateClient(config),
                config: config
                );

            return(context);
        }
Пример #4
0
 public static DocumentCollectionContext CreateCollectionContext(NameValueCollection appSettings)
 {
     return(CreateCollectionContext(
                CosmosDbClientConfig.CreateDocDbConfigFromAppConfig(appSettings)
                ));
 }