Esempio n. 1
0
        public async virtual Task <long> GetCountAsync(ICriterion filter)
        {
            var q = new AttributeSetsCountGetQuery();

            q.Filter = AttributeSetProxyUtils.GetFilterQueryValueString(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 virtual Task <long> GetCountAsync(ICriterion filter)
        {
            var q = new AttributeSetsCountGetQuery();

            q.Filter = AttributeSetProxyUtils.GetFilterQueryValueString(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));
        }