public async virtual Task <long> GetCountAsync(ICriterion filter)
        {
            var q = new OrganizationsCountGetQuery();

            q.Filter = OrganizationProxyUtils.GetFilterQueryValueString(filter);
            var req = new OrganizationsCountGetRequest();

            req.Query = q;
            var resp = await _ramlClient.OrganizationsCount.Get(req);

            OrganizationProxyUtils.ThrowOnHttpResponseError(resp);
            return(long.Parse(await resp.RawContent.ReadAsStringAsync()));
        }
Example #2
0
        public async virtual Task <long> GetCountAsync(ICriterion filter)
        {
            var q = new OrganizationsCountGetQuery();

            q.Filter = OrganizationProxyUtils.GetFilterQueryValueString(filter);
            var req = new OrganizationsCountGetRequest();

            req.Query = q;
            var resp = await _ramlClient.OrganizationsCount.Get(req);

            OrganizationProxyUtils.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));
        }