From 2105b3a24f4f44eac21d9ea5483d1eb2ab3f391f Mon Sep 17 00:00:00 2001 From: Nimrod Dolev Date: Sun, 6 Jan 2019 12:56:26 +0100 Subject: [PATCH 1/3] Added BaGet.Controllers.csproj to the solution --- BaGet.sln | 7 +++++++ src/BaGet.Controllers/BaGet.Controllers.csproj | 17 +++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 src/BaGet.Controllers/BaGet.Controllers.csproj diff --git a/BaGet.sln b/BaGet.sln index 3a8a61380..7d096a936 100644 --- a/BaGet.sln +++ b/BaGet.sln @@ -30,6 +30,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution .editorconfig = .editorconfig EndProjectSection EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BaGet.Controllers", "src\BaGet.Controllers\BaGet.Controllers.csproj", "{D68B56AC-98DD-4DA7-B4F8-1243538A8A5C}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -72,6 +74,10 @@ Global {D067D82E-D515-44D1-A832-C79F29418DFC}.Debug|Any CPU.Build.0 = Debug|Any CPU {D067D82E-D515-44D1-A832-C79F29418DFC}.Release|Any CPU.ActiveCfg = Release|Any CPU {D067D82E-D515-44D1-A832-C79F29418DFC}.Release|Any CPU.Build.0 = Release|Any CPU + {D68B56AC-98DD-4DA7-B4F8-1243538A8A5C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D68B56AC-98DD-4DA7-B4F8-1243538A8A5C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D68B56AC-98DD-4DA7-B4F8-1243538A8A5C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D68B56AC-98DD-4DA7-B4F8-1243538A8A5C}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -86,6 +92,7 @@ Global {A2D23427-9278-4D52-B31F-759212252832} = {26A0B557-53FB-4B9A-94C4-BCCF1BDCB0CC} {AC764A9A-9EAF-422B-9223-D3290C3CFD79} = {C237857D-AD8E-4C52-974F-6A8155BB0C18} {D067D82E-D515-44D1-A832-C79F29418DFC} = {26A0B557-53FB-4B9A-94C4-BCCF1BDCB0CC} + {D68B56AC-98DD-4DA7-B4F8-1243538A8A5C} = {26A0B557-53FB-4B9A-94C4-BCCF1BDCB0CC} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {1423C027-2C90-417F-8629-2A4CF107C055} diff --git a/src/BaGet.Controllers/BaGet.Controllers.csproj b/src/BaGet.Controllers/BaGet.Controllers.csproj new file mode 100644 index 000000000..87f3f6234 --- /dev/null +++ b/src/BaGet.Controllers/BaGet.Controllers.csproj @@ -0,0 +1,17 @@ + + + + netstandard2.0 + + + + + + + + + + + + + From 9e16fcfbd9700e4188e1b0259c5bb70a24686620 Mon Sep 17 00:00:00 2001 From: Nimrod Dolev Date: Sun, 6 Jan 2019 12:58:21 +0100 Subject: [PATCH 2/3] Moved controllers and associated code to the BaGet.Controllers project --- src/{BaGet => BaGet.Controllers}/Controllers/IndexController.cs | 0 .../Controllers/PackageController.cs | 0 .../Controllers/PackagePublishController.cs | 0 .../Controllers/Registration/RegistrationIndexController.cs | 0 .../Controllers/Registration/RegistrationLeafController.cs | 0 src/{BaGet => BaGet.Controllers}/Controllers/SearchController.cs | 0 src/{BaGet => BaGet.Controllers}/Controllers/SymbolController.cs | 0 .../Extensions/HttpRequestExtensions.cs | 0 .../Extensions/IRouteBuilderExtensions.cs | 0 src/{BaGet => BaGet.Controllers}/Extensions/UrlExtensions.cs | 0 src/{BaGet => BaGet.Controllers}/Routes.cs | 0 src/BaGet/BaGet.csproj | 1 + 12 files changed, 1 insertion(+) rename src/{BaGet => BaGet.Controllers}/Controllers/IndexController.cs (100%) rename src/{BaGet => BaGet.Controllers}/Controllers/PackageController.cs (100%) rename src/{BaGet => BaGet.Controllers}/Controllers/PackagePublishController.cs (100%) rename src/{BaGet => BaGet.Controllers}/Controllers/Registration/RegistrationIndexController.cs (100%) rename src/{BaGet => BaGet.Controllers}/Controllers/Registration/RegistrationLeafController.cs (100%) rename src/{BaGet => BaGet.Controllers}/Controllers/SearchController.cs (100%) rename src/{BaGet => BaGet.Controllers}/Controllers/SymbolController.cs (100%) rename src/{BaGet => BaGet.Controllers}/Extensions/HttpRequestExtensions.cs (100%) rename src/{BaGet => BaGet.Controllers}/Extensions/IRouteBuilderExtensions.cs (100%) rename src/{BaGet => BaGet.Controllers}/Extensions/UrlExtensions.cs (100%) rename src/{BaGet => BaGet.Controllers}/Routes.cs (100%) diff --git a/src/BaGet/Controllers/IndexController.cs b/src/BaGet.Controllers/Controllers/IndexController.cs similarity index 100% rename from src/BaGet/Controllers/IndexController.cs rename to src/BaGet.Controllers/Controllers/IndexController.cs diff --git a/src/BaGet/Controllers/PackageController.cs b/src/BaGet.Controllers/Controllers/PackageController.cs similarity index 100% rename from src/BaGet/Controllers/PackageController.cs rename to src/BaGet.Controllers/Controllers/PackageController.cs diff --git a/src/BaGet/Controllers/PackagePublishController.cs b/src/BaGet.Controllers/Controllers/PackagePublishController.cs similarity index 100% rename from src/BaGet/Controllers/PackagePublishController.cs rename to src/BaGet.Controllers/Controllers/PackagePublishController.cs diff --git a/src/BaGet/Controllers/Registration/RegistrationIndexController.cs b/src/BaGet.Controllers/Controllers/Registration/RegistrationIndexController.cs similarity index 100% rename from src/BaGet/Controllers/Registration/RegistrationIndexController.cs rename to src/BaGet.Controllers/Controllers/Registration/RegistrationIndexController.cs diff --git a/src/BaGet/Controllers/Registration/RegistrationLeafController.cs b/src/BaGet.Controllers/Controllers/Registration/RegistrationLeafController.cs similarity index 100% rename from src/BaGet/Controllers/Registration/RegistrationLeafController.cs rename to src/BaGet.Controllers/Controllers/Registration/RegistrationLeafController.cs diff --git a/src/BaGet/Controllers/SearchController.cs b/src/BaGet.Controllers/Controllers/SearchController.cs similarity index 100% rename from src/BaGet/Controllers/SearchController.cs rename to src/BaGet.Controllers/Controllers/SearchController.cs diff --git a/src/BaGet/Controllers/SymbolController.cs b/src/BaGet.Controllers/Controllers/SymbolController.cs similarity index 100% rename from src/BaGet/Controllers/SymbolController.cs rename to src/BaGet.Controllers/Controllers/SymbolController.cs diff --git a/src/BaGet/Extensions/HttpRequestExtensions.cs b/src/BaGet.Controllers/Extensions/HttpRequestExtensions.cs similarity index 100% rename from src/BaGet/Extensions/HttpRequestExtensions.cs rename to src/BaGet.Controllers/Extensions/HttpRequestExtensions.cs diff --git a/src/BaGet/Extensions/IRouteBuilderExtensions.cs b/src/BaGet.Controllers/Extensions/IRouteBuilderExtensions.cs similarity index 100% rename from src/BaGet/Extensions/IRouteBuilderExtensions.cs rename to src/BaGet.Controllers/Extensions/IRouteBuilderExtensions.cs diff --git a/src/BaGet/Extensions/UrlExtensions.cs b/src/BaGet.Controllers/Extensions/UrlExtensions.cs similarity index 100% rename from src/BaGet/Extensions/UrlExtensions.cs rename to src/BaGet.Controllers/Extensions/UrlExtensions.cs diff --git a/src/BaGet/Routes.cs b/src/BaGet.Controllers/Routes.cs similarity index 100% rename from src/BaGet/Routes.cs rename to src/BaGet.Controllers/Routes.cs diff --git a/src/BaGet/BaGet.csproj b/src/BaGet/BaGet.csproj index 18a385196..490165481 100644 --- a/src/BaGet/BaGet.csproj +++ b/src/BaGet/BaGet.csproj @@ -26,6 +26,7 @@ + From 715193d4fdf486e4d34fa4f5cdacd259991216ac Mon Sep 17 00:00:00 2001 From: Nimrod Dolev Date: Mon, 7 Jan 2019 09:10:26 +0100 Subject: [PATCH 3/3] Fixed tests after extraction of controllers into dedicated project By adding a call to `AddApplicationPart` to the service registration in the ServiceCollectionExtensions.ConfigureHttpServices method, registering the new assembly that contains the controllers. --- src/BaGet/Extensions/ServiceCollectionExtensions.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/BaGet/Extensions/ServiceCollectionExtensions.cs b/src/BaGet/Extensions/ServiceCollectionExtensions.cs index 28034da82..8d234acbb 100644 --- a/src/BaGet/Extensions/ServiceCollectionExtensions.cs +++ b/src/BaGet/Extensions/ServiceCollectionExtensions.cs @@ -128,6 +128,7 @@ public static IServiceCollection ConfigureHttpServices(this IServiceCollection s { services .AddMvc() + .AddApplicationPart(typeof(BaGet.Controllers.PackageController).Assembly) .SetCompatibilityVersion(CompatibilityVersion.Version_2_2); services.AddCors();