Ejemplo n.º 1
0
        public static async Task RespondPackagePublishAsync(
            this INugetServerProvider provider,
            HttpContext context)
        {
            var req = provider.GetRequestingModel(context);

            if (!req.IsValid())
            {
                provider.RespondNotFound(context);
                return;
            }
            if (!provider.IsValidApiKey(req))
            {
                provider.RespondNotFound(context);
                return;
            }
            if (req.IsPush())
            {
                await provider
                .RespondPutPackageAsync(context, req);

                return;
            }
            if (req.IsDelete())
            {
                await provider
                .RespondDeletePackageAsync(context, req);

                return;
            }
            provider.RespondNotFound(context);
        }