Exemplo n.º 1
0
 public static async Task Stats(IOwinContext context, NuGetSearcherManager searcherManager)
 {
     await ResponseHelpers.WriteResponseAsync(
         context,
         HttpStatusCode.OK,
         jsonWriter => ServiceInfoImpl.Stats(jsonWriter, searcherManager));
 }
Exemplo n.º 2
0
        public static async Task FindAsync(IOwinContext context, NuGetSearcherManager searcherManager)
        {
            var id     = context.Request.Query["id"] ?? string.Empty;
            var scheme = context.Request.Uri.Scheme;

            await ResponseHelpers.WriteResponseAsync(
                context,
                HttpStatusCode.OK,
                jsonWriter => ServiceImpl.Find(jsonWriter, searcherManager, id, scheme));
        }
Exemplo n.º 3
0
        public static async Task V3SearchAsync(IOwinContext context, NuGetSearcherManager searcherManager)
        {
            var skip = GetSkip(context);
            var take = GetTake(context);
            var includePrerelease  = GetIncludePrerelease(context);
            var includeExplanation = GetIncludeExplanation(context);

            var q      = context.Request.Query["q"] ?? string.Empty;
            var feed   = context.Request.Query["feed"];
            var scheme = context.Request.Uri.Scheme;

            await ResponseHelpers.WriteResponseAsync(
                context,
                HttpStatusCode.OK,
                jsonWriter => ServiceImpl.Search(jsonWriter, searcherManager, scheme, q, includePrerelease, skip, take, feed, includeExplanation));
        }
Exemplo n.º 4
0
        public static async Task V2SearchAsync(IOwinContext context, NuGetSearcherManager searcherManager)
        {
            var skip              = GetSkip(context);
            var take              = GetTake(context);
            var ignoreFilter      = GetIgnoreFilter(context);
            var countOnly         = GetCountOnly(context);
            var includePrerelease = GetIncludePrerelease(context);

            var q      = context.Request.Query["q"] ?? string.Empty;
            var sortBy = context.Request.Query["sortBy"] ?? string.Empty;
            var feed   = context.Request.Query["feed"];

            await ResponseHelpers.WriteResponseAsync(
                context,
                HttpStatusCode.OK,
                jsonWriter => GalleryServiceImpl.Search(jsonWriter, searcherManager, q, countOnly, includePrerelease, sortBy, skip, take, feed, ignoreFilter));
        }
Exemplo n.º 5
0
        public static async Task AutoCompleteAsync(IOwinContext context, NuGetSearcherManager searcherManager)
        {
            var skip = GetSkip(context);
            var take = GetTake(context);
            var includePrerelease  = GetIncludePrerelease(context);
            var includeExplanation = GetIncludeExplanation(context);

            var q  = context.Request.Query["q"];
            var id = context.Request.Query["id"];

            if (q == null && id == null)
            {
                q = string.Empty;
            }

            await ResponseHelpers.WriteResponseAsync(
                context,
                HttpStatusCode.OK,
                jsonWriter => ServiceImpl.AutoComplete(jsonWriter, searcherManager, q, id, includePrerelease, skip, take, includeExplanation));
        }