From 1e3874dd56eaf0b6f0df68b248f4aa0255878582 Mon Sep 17 00:00:00 2001 From: Mike Alhayek Date: Tue, 26 Mar 2024 14:27:38 -0700 Subject: [PATCH] Rename Method in MinimalAPI (#15594) --- .../Endpoints/Api/CreateEndpoint.cs | 14 +++++++------- .../Endpoints/Api/DeleteEndpoint.cs | 4 ++-- .../Endpoints/Api/GetEndpoint.cs | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/Endpoints/Api/CreateEndpoint.cs b/src/OrchardCore.Modules/OrchardCore.Contents/Endpoints/Api/CreateEndpoint.cs index 60ca5cdb575..9fe0aa09175 100644 --- a/src/OrchardCore.Modules/OrchardCore.Contents/Endpoints/Api/CreateEndpoint.cs +++ b/src/OrchardCore.Modules/OrchardCore.Contents/Endpoints/Api/CreateEndpoint.cs @@ -17,22 +17,22 @@ namespace OrchardCore.Contents.Endpoints.Api; public static class CreateEndpoint { + private static readonly JsonMergeSettings _updateJsonMergeSettings = new() + { + MergeArrayHandling = MergeArrayHandling.Replace, + }; + public static IEndpointRouteBuilder AddCreateContentEndpoint(this IEndpointRouteBuilder builder) { - builder.MapPost("api/content", ActionAsync) + builder.MapPost("api/content", HandleAsync) .AllowAnonymous() .DisableAntiforgery(); return builder; } - private static readonly JsonMergeSettings _updateJsonMergeSettings = new() - { - MergeArrayHandling = MergeArrayHandling.Replace, - }; - [Authorize(AuthenticationSchemes = "Api")] - private static async Task ActionAsync( + private static async Task HandleAsync( ContentItem model, IContentManager contentManager, IAuthorizationService authorizationService, diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/Endpoints/Api/DeleteEndpoint.cs b/src/OrchardCore.Modules/OrchardCore.Contents/Endpoints/Api/DeleteEndpoint.cs index e3b2b58505b..6aa0a648b5d 100644 --- a/src/OrchardCore.Modules/OrchardCore.Contents/Endpoints/Api/DeleteEndpoint.cs +++ b/src/OrchardCore.Modules/OrchardCore.Contents/Endpoints/Api/DeleteEndpoint.cs @@ -12,7 +12,7 @@ public static class DeleteEndpoint { public static IEndpointRouteBuilder AddDeleteContentEndpoint(this IEndpointRouteBuilder builder) { - builder.MapDelete("api/content/{contentItemId}", ActionAsync) + builder.MapDelete("api/content/{contentItemId}", HandleAsync) .AllowAnonymous() .DisableAntiforgery(); @@ -20,7 +20,7 @@ public static IEndpointRouteBuilder AddDeleteContentEndpoint(this IEndpointRoute } [Authorize(AuthenticationSchemes = "Api")] - private static async Task ActionAsync( + private static async Task HandleAsync( string contentItemId, IContentManager contentManager, IAuthorizationService authorizationService, diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/Endpoints/Api/GetEndpoint.cs b/src/OrchardCore.Modules/OrchardCore.Contents/Endpoints/Api/GetEndpoint.cs index 851ce7a07f3..faff9130759 100644 --- a/src/OrchardCore.Modules/OrchardCore.Contents/Endpoints/Api/GetEndpoint.cs +++ b/src/OrchardCore.Modules/OrchardCore.Contents/Endpoints/Api/GetEndpoint.cs @@ -12,7 +12,7 @@ public static class GetEndpoint { public static IEndpointRouteBuilder AddGetContentEndpoint(this IEndpointRouteBuilder builder) { - builder.MapGet("api/content/{contentItemId}", ActionAsync) + builder.MapGet("api/content/{contentItemId}", HandleAsync) .AllowAnonymous() .DisableAntiforgery(); @@ -20,7 +20,7 @@ public static IEndpointRouteBuilder AddGetContentEndpoint(this IEndpointRouteBui } [Authorize(AuthenticationSchemes = "Api")] - private static async Task ActionAsync( + private static async Task HandleAsync( string contentItemId, IContentManager contentManager, IAuthorizationService authorizationService,