Inheritance: ITable
コード例 #1
0
ファイル: SdbTable.cs プロジェクト: dfrandsen/Stratosphere
        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
ファイル: SdbTable.cs プロジェクト: petrohi/Stratosphere
        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;
        }