public DocumentDbRepository( DocumentDbUtil documentDbUtil, string collectionName) : this() { CollectionName = collectionName; DbUtil = documentDbUtil; }
private void Init() { // Instantiate the partition resolver as if it is not instantiated on initialization, // queries and inserts will fail. _partitionResolver = DocumentDbUtil.CreateHashPartitionResolver(Client, Database, _partitionKeyExtractor, PartitionCollectionsSelfLinks); }
static JsonTestFunction() { //Std double-check lock to set up DocumentDB Client if (!setupComplete) { lock (setupLock) { if (!setupComplete) { //Build up the data tier repository stack //Db Client first - just use the local emulator DbClient = DocumentDbUtil.CreateClient("https://localhost:8081", "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw=="); //And pipe that into the repo InventoryRepo = new InventoryRepository(DbClient, DbCfg); //And Done setupComplete = true; } } } }
public ActivityRepository(DocumentDbUtil documentDbUtil, string collectionName, IMapper mapper) : base(documentDbUtil, collectionName) { _mapper = mapper; CollectionUri = UriFactory.CreateDocumentCollectionUri(documentDbUtil.DatabaseName, collectionName); }