public async virtual Task <long> GetCountAsync(IEnumerable <KeyValuePair <string, object> > filter) { var q = new AttributeSetsCountGetQuery(); q.FilterTag = AttributeSetProxyUtils.GetFilterTagQueryValueString(filter); var req = new AttributeSetsCountGetRequest(); req.Query = q; var resp = await _ramlClient.AttributeSetsCount.Get(req); AttributeSetProxyUtils.ThrowOnHttpResponseError(resp); return(long.Parse(await resp.RawContent.ReadAsStringAsync())); }
public async Task <IEnumerable <IAttributeSetState> > GetAsync(IEnumerable <KeyValuePair <string, object> > filter, IList <string> orders = null, int firstResult = 0, int maxResults = int.MaxValue, IList <string> fields = null) { IEnumerable <IAttributeSetState> states = null; var q = new AttributeSetsGetQuery(); q.FirstResult = firstResult; q.MaxResults = maxResults; q.Sort = AttributeSetProxyUtils.GetOrdersQueryValueString(orders); q.Fields = AttributeSetProxyUtils.GetReturnedFieldsQueryValueString(fields, QueryFieldValueSeparator); q.FilterTag = AttributeSetProxyUtils.GetFilterTagQueryValueString(filter); var req = new AttributeSetsGetRequest(); req.Query = q; var resp = await _ramlClient.AttributeSets.Get(req); AttributeSetProxyUtils.ThrowOnHttpResponseError(resp); states = (resp.Content == null) ? null : resp.Content.Select(e => e.ToAttributeSetState()); return(states); }
public async virtual Task <long> GetCountAsync(IEnumerable <KeyValuePair <string, object> > filter) { var q = new AttributeSetsCountGetQuery(); q.FilterTag = AttributeSetProxyUtils.GetFilterTagQueryValueString(filter); var req = new AttributeSetsCountGetRequest(); req.Query = q; var resp = await _ramlClient.AttributeSetsCount.Get(req); AttributeSetProxyUtils.ThrowOnHttpResponseError(resp); string str = await resp.RawContent.ReadAsStringAsync(); if (str.StartsWith("\"")) { str = str.Substring(1); } if (str.EndsWith("\"")) { str = str.Substring(0, str.Length - 1); } return(long.Parse(str)); }