예제 #1
0
        public static Dictionary <string, string> GetQueryParameters(QueryModel queryModel)
        {
            var visitor = new MpQueryModelVisitor();

            visitor.VisitQueryModel(queryModel);
            return(visitor.QueryParameters);
        }
        public IEnumerable <T> ExecuteCollection <T>(QueryModel queryModel)
        {
            if (typeof(T) != typeof(TResource))
            {
                throw new InvalidOperationException();
            }

            var queryParameters = MpQueryModelVisitor.GetQueryParameters(queryModel);

            return
                (Resource <TResource> .GetList(_apiPath, _accessToken, _useCache, queryParameters)
                 .Cast <T>());
        }