public async Task <IEnumerable <IMovementConfirmationState> > GetAsync(IEnumerable <KeyValuePair <string, object> > filter, IList <string> orders = null, int firstResult = 0, int maxResults = int.MaxValue, IList <string> fields = null) { IEnumerable <IMovementConfirmationState> states = null; var q = new MovementConfirmationsGetQuery(); q.FirstResult = firstResult; q.MaxResults = maxResults; q.Sort = MovementConfirmationProxyUtils.GetOrdersQueryValueString(orders); q.Fields = MovementConfirmationProxyUtils.GetReturnedFieldsQueryValueString(fields, QueryFieldValueSeparator); q.FilterTag = MovementConfirmationProxyUtils.GetFilterTagQueryValueString(filter); var req = new MovementConfirmationsGetRequest(); req.Query = q; var resp = await _ramlClient.MovementConfirmations.Get(req); MovementConfirmationProxyUtils.ThrowOnHttpResponseError(resp); states = (resp.Content == null) ? null : resp.Content.Select(e => e.ToMovementConfirmationState()); return(states); }
public async virtual Task <long> GetCountAsync(IEnumerable <KeyValuePair <string, object> > filter) { var q = new MovementConfirmationsCountGetQuery(); q.FilterTag = MovementConfirmationProxyUtils.GetFilterTagQueryValueString(filter); var req = new MovementConfirmationsCountGetRequest(); req.Query = q; var resp = await _ramlClient.MovementConfirmationsCount.Get(req); MovementConfirmationProxyUtils.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)); }