Inheritance: ITable
示例#1
0
        public static bool TryCreate(string serviceId, string serviceSecret, string domainName, bool withConsistency, int?selectLimit, bool ensureDomain, out SdbTable table)
        {
            SdbService service         = new SdbService(serviceId, serviceSecret);
            XElement   responseElement = service.Execute(new ListDomainsBuilder());

            if (responseElement.Descendants(Sdb + "DomainName").Select(n => n.Value).Contains(domainName))
            {
                table = new SdbTable(service, domainName, withConsistency, selectLimit);
                return(true);
            }

            if (ensureDomain)
            {
                table = Create(service, domainName, withConsistency, selectLimit);
                return(true);
            }

            table = null;
            return(false);
        }
示例#2
0
        public static bool TryCreate(string serviceId, string serviceSecret, string domainName, bool withConsistency, int? selectLimit, bool ensureDomain, out SdbTable table)
        {
            SdbService service = new SdbService(serviceId, serviceSecret);
            XElement responseElement = service.Execute(new ListDomainsBuilder());

            if (responseElement.Descendants(Sdb + "DomainName").Select(n => n.Value).Contains(domainName))
            {
                table = new SdbTable(service, domainName, withConsistency, selectLimit);
                return true;
            }

            if (ensureDomain)
            {
                table = Create(service, domainName, withConsistency, selectLimit);
                return true;
            }

            table = null;
            return false;
        }