private SdbTable(SdbService service, string domainName, bool withConsistency, int?selectLimit) { _service = service; _domainName = domainName; _withConsistency = withConsistency; _selectLimit = selectLimit; }
private static IEnumerable <XElement> SelectElements(SdbService service, string selectExpression, bool withConsistency) { string nextToken = null; do { XElement responseElement = service.Execute( new SelectBuilder(selectExpression, nextToken, withConsistency)); foreach (XElement itemElement in responseElement.Descendants(Sdb + "Item")) { yield return(itemElement); } XElement nextTokenElement = responseElement.Descendants(Sdb + "NextToken").FirstOrDefault(); if (nextTokenElement == null) { nextToken = null; } else { nextToken = nextTokenElement.Value; } }while (nextToken != null); }
private SdbTable(SdbService service, string domainName, bool withConsistency, int? selectLimit) { _service = service; _domainName = domainName; _withConsistency = withConsistency; _selectLimit = selectLimit; }
public static IEnumerable <SdbTable> ListTables(string serviceId, string serviceSecret, bool withConsistency, int?selectLimit) { SdbService service = new SdbService(serviceId, serviceSecret); XElement responseElement = service.Execute(new ListDomainsBuilder()); foreach (string domainName in responseElement.Descendants(Sdb + "DomainName").Select(n => n.Value)) { yield return(new SdbTable(service, domainName, withConsistency, selectLimit)); } }
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); }
public static SdbTable Create(string serviceId, string serviceSecret, string domainName, bool withConsistency, int?selectLimit) { SdbService service = new SdbService(serviceId, serviceSecret); return(Create(service, domainName, withConsistency, selectLimit));; }
private static SdbTable Create(SdbService service, string domainName, bool withConsistency, int?selectLimit) { service.Execute(new CreateDomainBuilder(domainName)); return(new SdbTable(service, domainName, withConsistency, selectLimit)); }
public static void ResetBoxUsage() { SdbService.ResetBoxUsage(); }
public static SdbTable Create(string serviceId, string serviceSecret, string domainName, bool withConsistency, int? selectLimit) { SdbService service = new SdbService(serviceId, serviceSecret); return Create(service, domainName, withConsistency, selectLimit); ; }
private static IEnumerable<XElement> SelectElements(SdbService service, string selectExpression, bool withConsistency) { string nextToken = null; do { XElement responseElement = service.Execute( new SelectBuilder(selectExpression, nextToken, withConsistency)); foreach (XElement itemElement in responseElement.Descendants(Sdb + "Item")) { yield return itemElement; } XElement nextTokenElement = responseElement.Descendants(Sdb + "NextToken").FirstOrDefault(); if (nextTokenElement == null) { nextToken = null; } else { nextToken = nextTokenElement.Value; } } while (nextToken != null); }
private static SdbTable Create(SdbService service, string domainName, bool withConsistency, int? selectLimit) { service.Execute(new CreateDomainBuilder(domainName)); return new SdbTable(service, domainName, withConsistency, selectLimit); }
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; }
public static IEnumerable<SdbTable> ListTables(string serviceId, string serviceSecret, bool withConsistency, int? selectLimit) { SdbService service = new SdbService(serviceId, serviceSecret); XElement responseElement = service.Execute(new ListDomainsBuilder()); foreach (string domainName in responseElement.Descendants(Sdb + "DomainName").Select(n => n.Value)) { yield return new SdbTable(service, domainName, withConsistency, selectLimit); } }