예제 #1
0
파일: Resolver.cs 프로젝트: tzkwizard/Azure
 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;
 }
예제 #2
0
파일: Resolver.cs 프로젝트: tzkwizard/Azure
        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;
        }