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

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

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

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

            q.Filter = OrderItemShipGrpInvReservationProxyUtils.GetFilterQueryValueString(filter);
            var req = new OrderItemShipGrpInvReservationsCountGetRequest();

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

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