public async Task WhenAsync(MergePatchOrderItemShipGrpInvReservationDto c)
        {
            var idObj         = OrderItemShipGrpInvReservationProxyUtils.ToIdString((c as IMergePatchOrderItemShipGrpInvReservation).OrderItemShipGrpInvResId);
            var uriParameters = new OrderItemShipGrpInvReservationUriParameters();

            uriParameters.Id = idObj;

            var req  = new OrderItemShipGrpInvReservationPatchRequest(uriParameters, (MergePatchOrderItemShipGrpInvReservationDto)c);
            var resp = await _ramlClient.OrderItemShipGrpInvReservation.Patch(req);

            OrderItemShipGrpInvReservationProxyUtils.ThrowOnHttpResponseError(resp);
        }
        public async Task <IOrderItemShipGrpInvReservationState> GetHistoryStateAsync(OrderItemShipGrpInvResId orderItemShipGrpInvResId, long version)
        {
            var idObj         = OrderItemShipGrpInvReservationProxyUtils.ToIdString(orderItemShipGrpInvResId);
            var uriParameters = new OrderItemShipGrpInvReservationHistoryStateUriParameters();

            uriParameters.Id      = idObj;
            uriParameters.Version = version.ToString();

            var req  = new OrderItemShipGrpInvReservationHistoryStateGetRequest(uriParameters);
            var resp = await _ramlClient.OrderItemShipGrpInvReservationHistoryState.Get(req);

            OrderItemShipGrpInvReservationProxyUtils.ThrowOnHttpResponseError(resp);
            return((resp.Content == null) ? null : resp.Content.ToOrderItemShipGrpInvReservationState());
        }
        public async Task <IOrderItemShipGrpInvReservationEvent> GetStateEventAsync(OrderItemShipGrpInvResId orderItemShipGrpInvResId, long version)
        {
            var idObj         = OrderItemShipGrpInvReservationProxyUtils.ToIdString(orderItemShipGrpInvResId);
            var uriParameters = new OrderItemShipGrpInvReservationStateEventUriParameters();

            uriParameters.Id      = idObj;
            uriParameters.Version = version.ToString();

            var req  = new OrderItemShipGrpInvReservationStateEventGetRequest(uriParameters);
            var resp = await _ramlClient.OrderItemShipGrpInvReservationStateEvent.Get(req);

            OrderItemShipGrpInvReservationProxyUtils.ThrowOnHttpResponseError(resp);
            return(resp.Content);
        }
        public async Task <IOrderItemShipGrpInvReservationState> GetAsync(OrderItemShipGrpInvResId orderItemShipGrpInvResId)
        {
            IOrderItemShipGrpInvReservationState state = null;
            var idObj         = OrderItemShipGrpInvReservationProxyUtils.ToIdString(orderItemShipGrpInvResId);
            var uriParameters = new OrderItemShipGrpInvReservationUriParameters();

            uriParameters.Id = idObj;

            var req = new OrderItemShipGrpInvReservationGetRequest(uriParameters);

            var resp = await _ramlClient.OrderItemShipGrpInvReservation.Get(req);

            OrderItemShipGrpInvReservationProxyUtils.ThrowOnHttpResponseError(resp);
            state = (resp.Content == null) ? null : resp.Content.ToOrderItemShipGrpInvReservationState();
            return(state);
        }
        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 Task WhenAsync(DeleteOrderItemShipGrpInvReservationDto c)
        {
            var idObj         = OrderItemShipGrpInvReservationProxyUtils.ToIdString((c as IDeleteOrderItemShipGrpInvReservation).OrderItemShipGrpInvResId);
            var uriParameters = new OrderItemShipGrpInvReservationUriParameters();

            uriParameters.Id = idObj;

            var q = new OrderItemShipGrpInvReservationDeleteQuery();

            q.CommandId   = c.CommandId;
            q.RequesterId = c.RequesterId;
            q.Version     = Convert.ToString(c.Version);

            var req = new OrderItemShipGrpInvReservationDeleteRequest(uriParameters);

            req.Query = q;

            var resp = await _ramlClient.OrderItemShipGrpInvReservation.Delete(req);

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