public async Task <IEnumerable <ILocatorState> > GetAsync(ICriterion filter, IList <string> orders = null, int firstResult = 0, int maxResults = int.MaxValue, IList <string> fields = null)
        {
            IEnumerable <ILocatorState> states = null;
            var q = new LocatorsGetQuery();

            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 LocatorsGetRequest();

            req.Query = q;
            var resp = await _ramlClient.Locators.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));
        }
Exemplo n.º 3
0
        public async Task <IEnumerable <ILocatorState> > GetChildrenAsync(string parentId, 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();
            var parentIdObj = (parentId);

            q.ParentId    = parentIdObj;
            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 == null) ? null : resp.Content.Select(e => e.ToLocatorState());
            return(states);
        }