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