public async Task WhenAsync(MergePatchInventoryItemRequirementEntryMvoDto c)
        {
            var idObj         = InventoryItemRequirementEntryMvoProxyUtils.ToIdString((c as IMergePatchInventoryItemRequirementEntryMvo).InventoryItemRequirementEntryId);
            var uriParameters = new InventoryItemRequirementEntryMvoUriParameters();

            uriParameters.Id = idObj;

            var req  = new InventoryItemRequirementEntryMvoPatchRequest(uriParameters, (MergePatchInventoryItemRequirementEntryMvoDto)c);
            var resp = await _ramlClient.InventoryItemRequirementEntryMvo.Patch(req);

            InventoryItemRequirementEntryMvoProxyUtils.ThrowOnHttpResponseError(resp);
        }
        public async Task <IInventoryItemRequirementEntryMvoState> GetHistoryStateAsync(InventoryItemRequirementEntryId inventoryItemRequirementEntryId, long version)
        {
            var idObj         = InventoryItemRequirementEntryMvoProxyUtils.ToIdString(inventoryItemRequirementEntryId);
            var uriParameters = new InventoryItemRequirementEntryMvoHistoryStateUriParameters();

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

            var req  = new InventoryItemRequirementEntryMvoHistoryStateGetRequest(uriParameters);
            var resp = await _ramlClient.InventoryItemRequirementEntryMvoHistoryState.Get(req);

            InventoryItemRequirementEntryMvoProxyUtils.ThrowOnHttpResponseError(resp);
            return((resp.Content == null) ? null : resp.Content.ToInventoryItemRequirementEntryMvoState());
        }
        public async Task <IInventoryItemRequirementEntryMvoState> GetAsync(InventoryItemRequirementEntryId inventoryItemRequirementEntryId)
        {
            IInventoryItemRequirementEntryMvoState state = null;
            var idObj         = InventoryItemRequirementEntryMvoProxyUtils.ToIdString(inventoryItemRequirementEntryId);
            var uriParameters = new InventoryItemRequirementEntryMvoUriParameters();

            uriParameters.Id = idObj;

            var req = new InventoryItemRequirementEntryMvoGetRequest(uriParameters);

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

            InventoryItemRequirementEntryMvoProxyUtils.ThrowOnHttpResponseError(resp);
            state = (resp.Content == null) ? null : resp.Content.ToInventoryItemRequirementEntryMvoState();
            return(state);
        }
        public async Task <IEnumerable <IInventoryItemRequirementEntryMvoState> > GetAsync(ICriterion filter, IList <string> orders = null, int firstResult = 0, int maxResults = int.MaxValue, IList <string> fields = null)
        {
            IEnumerable <IInventoryItemRequirementEntryMvoState> states = null;
            var q = new InventoryItemRequirementEntryMvosGetQuery();

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

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

            InventoryItemRequirementEntryMvoProxyUtils.ThrowOnHttpResponseError(resp);
            states = (resp.Content == null) ? null : resp.Content.Select(e => e.ToInventoryItemRequirementEntryMvoState());
            return(states);
        }
        public async Task WhenAsync(DeleteInventoryItemRequirementEntryMvoDto c)
        {
            var idObj         = InventoryItemRequirementEntryMvoProxyUtils.ToIdString((c as IDeleteInventoryItemRequirementEntryMvo).InventoryItemRequirementEntryId);
            var uriParameters = new InventoryItemRequirementEntryMvoUriParameters();

            uriParameters.Id = idObj;

            var q = new InventoryItemRequirementEntryMvoDeleteQuery();

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

            var req = new InventoryItemRequirementEntryMvoDeleteRequest(uriParameters);

            req.Query = q;

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

            InventoryItemRequirementEntryMvoProxyUtils.ThrowOnHttpResponseError(resp);
        }
        public async virtual Task <long> GetCountAsync(ICriterion filter)
        {
            var q = new InventoryItemRequirementEntryMvosCountGetQuery();

            q.Filter = InventoryItemRequirementEntryMvoProxyUtils.GetFilterQueryValueString(filter);
            var req = new InventoryItemRequirementEntryMvosCountGetRequest();

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

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