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

            q.Filter = AttributeUseMvoProxyUtils.GetFilterQueryValueString(filter);
            var req = new AttributeUseMvosCountGetRequest();

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

            AttributeUseMvoProxyUtils.ThrowOnHttpResponseError(resp);
            return(long.Parse(await resp.RawContent.ReadAsStringAsync()));
        }
        public async Task <IEnumerable <IAttributeUseMvoState> > GetAsync(ICriterion filter, IList <string> orders = null, int firstResult = 0, int maxResults = int.MaxValue, IList <string> fields = null)
        {
            IEnumerable <IAttributeUseMvoState> states = null;
            var q = new AttributeUseMvosGetQuery();

            q.FirstResult = firstResult;
            q.MaxResults  = maxResults;
            q.Sort        = AttributeUseMvoProxyUtils.GetOrdersQueryValueString(orders);
            q.Fields      = AttributeUseMvoProxyUtils.GetReturnedFieldsQueryValueString(fields, QueryFieldValueSeparator);
            q.Filter      = AttributeUseMvoProxyUtils.GetFilterQueryValueString(filter);
            var req = new AttributeUseMvosGetRequest();

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

            AttributeUseMvoProxyUtils.ThrowOnHttpResponseError(resp);
            states = resp.Content;
            return(states);
        }
Exemple #3
0
        public async virtual Task <long> GetCountAsync(ICriterion filter)
        {
            var q = new AttributeUseMvosCountGetQuery();

            q.Filter = AttributeUseMvoProxyUtils.GetFilterQueryValueString(filter);
            var req = new AttributeUseMvosCountGetRequest();

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

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