From e6f434962128ca103483e5bb159f82eb62c65b06 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Sun, 5 Sep 2021 19:33:39 +0100 Subject: [PATCH] reorg --- .../SafeNameAttribute.cs | 2 +- .../Controllers/PackagesController.Delete.cs | 18 +----------------- .../Controllers/PackagesController.Files.cs | 6 +----- 3 files changed, 3 insertions(+), 23 deletions(-) rename src/isnd/{Controllers => Attributes}/SafeNameAttribute.cs (94%) diff --git a/src/isnd/Controllers/SafeNameAttribute.cs b/src/isnd/Attributes/SafeNameAttribute.cs similarity index 94% rename from src/isnd/Controllers/SafeNameAttribute.cs rename to src/isnd/Attributes/SafeNameAttribute.cs index b354173..771e3b9 100644 --- a/src/isnd/Controllers/SafeNameAttribute.cs +++ b/src/isnd/Attributes/SafeNameAttribute.cs @@ -2,7 +2,7 @@ using System; using System.ComponentModel.DataAnnotations; using System.Linq; -namespace isnd.Controllers +namespace isnd.Attributes { internal class SafeNameAttribute : ValidationAttribute { diff --git a/src/isnd/Controllers/PackagesController.Delete.cs b/src/isnd/Controllers/PackagesController.Delete.cs index 35f425f..3cd90c3 100644 --- a/src/isnd/Controllers/PackagesController.Delete.cs +++ b/src/isnd/Controllers/PackagesController.Delete.cs @@ -1,28 +1,12 @@ - -using System; -using System.Collections.Generic; -using System.IO; -using System.IO.Compression; -using System.Linq; -using System.Text; using System.Threading.Tasks; -using Microsoft.AspNetCore.DataProtection; using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Logging; -using NuGet.Packaging.Core; -using NuGet.Versioning; -using isnd.Data; using isnd.Helpers; -using Microsoft.AspNetCore.Http; -using isnd.Data.Catalog; using System.ComponentModel.DataAnnotations; - +using isnd.Attributes; namespace isnd.Controllers { - public partial class PackagesController { - [HttpDelete(_pkgRootPrefix + ApiConfig.Delete + "/{id}/{*lower}")] public async Task Delete( [FromRoute][SafeName][Required] string id, diff --git a/src/isnd/Controllers/PackagesController.Files.cs b/src/isnd/Controllers/PackagesController.Files.cs index f435b35..0357b70 100644 --- a/src/isnd/Controllers/PackagesController.Files.cs +++ b/src/isnd/Controllers/PackagesController.Files.cs @@ -1,11 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.IO; -using System.Linq; -using System.Threading.Tasks; -using isnd.ViewModels; using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; - +using isnd.Attributes; namespace isnd.Controllers {