public virtual ActionResult PatchCuratedPackage(
            string curatedFeedName,
            string curatedPackageId,
            ModifyCuratedPackageRequest request)
        {
            var curatedFeed = GetService<ICuratedFeedByNameQuery>().Execute(curatedFeedName, includePackages: true);
            if (curatedFeed == null)
                return HttpNotFound();

            var curatedPackage = curatedFeed.Packages.SingleOrDefault(cp => cp.PackageRegistration.Id == curatedPackageId);
            if (curatedPackage == null)
                return HttpNotFound();

            if (!curatedFeed.Managers.Any(manager => manager.Username == Identity.Name))
                return new HttpStatusCodeResult(403);

            if (!ModelState.IsValid)
                return new HttpStatusCodeResult(400);

            GetService<IModifyCuratedPackageCommand>().Execute(
                curatedFeed.Key,
                curatedPackage.Key,
                request.Included);

            return new HttpStatusCodeResult(204);
        }
        public virtual ActionResult PatchCuratedPackage(
            string curatedFeedName,
            string curatedPackageId,
            ModifyCuratedPackageRequest request)
        {
            var curatedFeed = CuratedFeedService.GetFeedByName(curatedFeedName, includePackages: true);
            if (curatedFeed == null)
            {
                return HttpNotFound();
            }

            var curatedPackage = curatedFeed.Packages.SingleOrDefault(cp => cp.PackageRegistration.Id == curatedPackageId);
            if (curatedPackage == null)
            {
                return HttpNotFound();
            }

            if (curatedFeed.Managers.All(manager => manager.Username != User.Identity.Name))
            {
                return new HttpStatusCodeResult(403);
            }

            if (!ModelState.IsValid)
            {
                return new HttpStatusCodeResult(400);
            }

            CuratedFeedService.ModifyCuratedPackage(
                curatedFeed.Key,
                curatedPackage.Key,
                request.Included);

            return new HttpStatusCodeResult(204);
        }
        public virtual async Task <ActionResult> PatchCuratedPackage(
            string curatedFeedName,
            string curatedPackageId,
            ModifyCuratedPackageRequest request)
        {
            var curatedFeed = CuratedFeedService.GetFeedByName(curatedFeedName, includePackages: true);

            if (curatedFeed == null)
            {
                return(HttpNotFound());
            }

            var curatedPackage = curatedFeed.Packages.SingleOrDefault(cp => cp.PackageRegistration.Id == curatedPackageId);

            if (curatedPackage == null)
            {
                return(HttpNotFound());
            }

            if (curatedFeed.Managers.All(manager => manager.Username != User.Identity.Name))
            {
                return(new HttpStatusCodeResult(403));
            }

            if (!ModelState.IsValid)
            {
                return(new HttpStatusCodeResult(400));
            }

            await CuratedFeedService.ModifyCuratedPackageAsync(
                curatedFeed.Key,
                curatedPackage.Key,
                request.Included);

            return(new HttpStatusCodeResult(204));
        }
        public virtual ActionResult PatchCuratedPackage(
            string curatedFeedName,
            string curatedPackageId,
            ModifyCuratedPackageRequest request)
        {
            var curatedFeed = GetService <ICuratedFeedByNameQuery>().Execute(curatedFeedName, includePackages: true);

            if (curatedFeed == null)
            {
                return(HttpNotFound());
            }

            var curatedPackage = curatedFeed.Packages.SingleOrDefault(cp => cp.PackageRegistration.Id == curatedPackageId);

            if (curatedPackage == null)
            {
                return(HttpNotFound());
            }

            if (curatedFeed.Managers.All(manager => manager.Username != Identity.Name))
            {
                return(new HttpStatusCodeResult(403));
            }

            if (!ModelState.IsValid)
            {
                return(new HttpStatusCodeResult(400));
            }

            GetService <IModifyCuratedPackageCommand>().Execute(
                curatedFeed.Key,
                curatedPackage.Key,
                request.Included);

            return(new HttpStatusCodeResult(204));
        }