public async Task <IEnumerable <IOrderShipGroupMvoState> > GetAsync(ICriterion filter, IList <string> orders = null, int firstResult = 0, int maxResults = int.MaxValue, IList <string> fields = null)
        {
            IEnumerable <IOrderShipGroupMvoState> states = null;
            var q = new OrderShipGroupMvosGetQuery();

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

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

            OrderShipGroupMvoProxyUtils.ThrowOnHttpResponseError(resp);
            states = (resp.Content == null) ? null : resp.Content.Select(e => e.ToOrderShipGroupMvoState());
            return(states);
        }
        public async virtual Task <long> GetCountAsync(ICriterion filter)
        {
            var q = new OrderShipGroupMvosCountGetQuery();

            q.Filter = OrderShipGroupMvoProxyUtils.GetFilterQueryValueString(filter);
            var req = new OrderShipGroupMvosCountGetRequest();

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

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