示例#1
0
        public virtual S Search <S>(BaseQO qo) where S : new()
        {
            if (string.IsNullOrWhiteSpace(SearchUrl))
            {
                throw new NotImplementedException("The property SearchUrl has no value on the ApiSet.");
            }
            var request = CreateRestRequest(Method.GET, SearchUrl);

            foreach (var pair in qo.ToDictionary())
            {
                request.AddParameter(pair.Key, pair.Value);
            }

            var list = ExecuteCustomRequest <S>(request);

            return(list.Data);
        }
示例#2
0
        public virtual F1Collection <T> FindBy(BaseQO qo)
        {
            var collection = new F1Collection <T>();

            if (string.IsNullOrWhiteSpace(SearchUrl))
            {
                throw new NotImplementedException("The property SearchUrl has no value on the ApiSet.");
            }

            var request = CreateRestRequest(Method.GET, SearchUrl);

            foreach (var pair in qo.ToDictionary())
            {
                request.AddParameter(pair.Key, pair.Value);
            }

            var item = ExecuteListRequest(request);

            this.PopulateHeaderInformation(collection, item);
            collection.Items.AddRange(item.Data);

            return(collection);
        }