public async Task <IEnumerable <IGoodIdentificationTypeState> > GetAsync(IEnumerable <KeyValuePair <string, object> > filter, IList <string> orders = null, int firstResult = 0, int maxResults = int.MaxValue, IList <string> fields = null) { IEnumerable <IGoodIdentificationTypeState> states = null; var q = new GoodIdentificationTypesGetQuery(); q.FirstResult = firstResult; q.MaxResults = maxResults; q.Sort = GoodIdentificationTypeProxyUtils.GetOrdersQueryValueString(orders); q.Fields = GoodIdentificationTypeProxyUtils.GetReturnedFieldsQueryValueString(fields, QueryFieldValueSeparator); q.FilterTag = GoodIdentificationTypeProxyUtils.GetFilterTagQueryValueString(filter); var req = new GoodIdentificationTypesGetRequest(); req.Query = q; var resp = await _ramlClient.GoodIdentificationTypes.Get(req); GoodIdentificationTypeProxyUtils.ThrowOnHttpResponseError(resp); states = (resp.Content == null) ? null : resp.Content.Select(e => e.ToGoodIdentificationTypeState()); return(states); }
public async virtual Task <long> GetCountAsync(IEnumerable <KeyValuePair <string, object> > filter) { var q = new GoodIdentificationTypesCountGetQuery(); q.FilterTag = GoodIdentificationTypeProxyUtils.GetFilterTagQueryValueString(filter); var req = new GoodIdentificationTypesCountGetRequest(); req.Query = q; var resp = await _ramlClient.GoodIdentificationTypesCount.Get(req); GoodIdentificationTypeProxyUtils.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)); }