private static void ClearAllPackages()
        {
            List <Package> packages = PackageDAO.Read(p => true).Result;

            packages.ForEach(p =>
            {
                PackageDAO.Delete(p.Id);
                FileStore.DeleteFile(p.Id);
            });
        }
예제 #2
0
        public void OneTimeTearDown()
        {
            List <Package> packages = PackageDAO.Read(p => true).Result;

            packages.ForEach(p =>
            {
                PackageDAO.Delete(p.Id);
                FileStore.DeleteFile(p.Id);
            });
        }
예제 #3
0
        public static HttpResponseMessage Delete(HttpRequestMessage request, string id, string version)
        {
            Package package = PackageDAO.Read(id, version).Result;

            if (package == null)
            {
                throw new PackageNotFoundException();
            }
            if (!FileStore.DeleteFile(package.Id))
            {
                throw new InternalServerErrorException();
            }
            if (!PackageDAO.Delete(package.Id).Result)
            {
                throw new InternalServerErrorException();
            }

            return(request.CreateResponse(HttpStatusCode.OK));
        }