コード例 #1
0
        public V3SimpleSearchResource(V3RawSearchResource rawSearch)
        {
            if (rawSearch == null)
            {
                throw new ArgumentNullException("rawSearch");
            }

            _rawSearch = rawSearch;
        }
コード例 #2
0
        public async Task <INuGetResource> Create(SourceRepository source)
        {
            V3RawSearchResource    curResource  = null;
            V3ServiceIndexResource serviceIndex = await source.GetResource <V3ServiceIndexResource>();

            if (serviceIndex != null)
            {
                var endpoints = serviceIndex["SearchQueryService"].ToArray();

                if (endpoints.Length > 0)
                {
                    HttpHandlerResource handler = await source.GetResource <HttpHandlerResource>();

                    // construct a new resource
                    curResource = new V3RawSearchResource(handler.MessageHandler, endpoints);
                }
            }

            return(curResource);
        }