private static void ClearAllPackages() { List <Package> packages = PackageDAO.Read(p => true).Result; packages.ForEach(p => { PackageDAO.Delete(p.Id); FileStore.DeleteFile(p.Id); }); }
public void OneTimeTearDown() { List <Package> packages = PackageDAO.Read(p => true).Result; packages.ForEach(p => { PackageDAO.Delete(p.Id); FileStore.DeleteFile(p.Id); }); }
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)); }