public async Task<bool> InitResolver() { //generate var rangeResolver = GenerateInitResolver(); //clean await DeleteDocById(_masterCollectionSelfLink, "AZresolver"); //create var resolver = new RangeResolver { id = "AZresolver", resolver = rangeResolver }; var res = await CreateDocument(resolver); return res.StatusCode==HttpStatusCode.Created; }
public async Task<bool> UpdateResolver(DocumentCollection newDc) { var oldResolver = GetResolver(); if (oldResolver == null) return false; var newResolver = GetUpdateResolver(oldResolver, newDc); if (newResolver == null) return false; await DeleteDocById(_masterCollectionSelfLink, "AZresolver"); var resolver = new RangeResolver { id = "AZresolver", resolver = newResolver }; var res = await CreateDocument(resolver); return res.StatusCode==HttpStatusCode.Created; }