public async Task <IEnumerable <ILocatorState> > GetRootsAsync(ICriterion filter, IList <string> orders = null, int firstResult = 0, int maxResults = int.MaxValue, IList <string> fields = null) { IEnumerable <ILocatorState> states = null; var q = new LocatorTreesGetQuery(); q.FirstResult = firstResult; q.MaxResults = maxResults; q.Sort = LocatorProxyUtils.GetOrdersQueryValueString(orders); q.Fields = LocatorProxyUtils.GetReturnedFieldsQueryValueString(fields, QueryFieldValueSeparator); q.Filter = LocatorProxyUtils.GetFilterQueryValueString(filter); var req = new LocatorTreesGetRequest(); req.Query = q; var resp = await _ramlClient.LocatorTrees.Get(req); LocatorProxyUtils.ThrowOnHttpResponseError(resp); states = (resp.Content == null) ? null : resp.Content.Select(e => e.ToLocatorState()); return(states); }
public async Task <IEnumerable <string> > GetRootIdsAsync(IEnumerable <KeyValuePair <string, object> > filter, IList <string> orders = null, int firstResult = 0, int maxResults = int.MaxValue, IList <string> fields = null) { IEnumerable <ILocatorState> states = null; var q = new LocatorTreesGetQuery(); q.FirstResult = firstResult; q.MaxResults = maxResults; q.Sort = LocatorProxyUtils.GetOrdersQueryValueString(orders); q.Fields = LocatorProxyUtils.GetReturnedFieldsQueryValueString(fields, QueryFieldValueSeparator); q.FilterTag = LocatorProxyUtils.GetFilterTagQueryValueString(filter); var req = new LocatorTreesGetRequest(); req.Query = q; var resp = await _ramlClient.LocatorTrees.Get(req); LocatorProxyUtils.ThrowOnHttpResponseError(resp); states = resp.Content; return(LocatorProxyUtils.ToIdCollection(states)); }