From 8dd2928906b9484ac769cc05982a3ca80e1ddad6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ha=CC=8Akan=20Edling?= Date: Thu, 31 Mar 2022 22:59:51 +0200 Subject: [PATCH] Added endpoint registration for classic startup. Fixes #1844 --- Directory.Build.props | 2 +- .../Extensions/PiranhaHostingExtensions.cs | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index ff72da898..b54ae0dab 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,6 @@ - 10.0.3 + 10.0.4 Piranha CMS Piranha CMS Copyright (c) .NET Foundation and Contributors diff --git a/core/Piranha.AspNetCore.Hosting/Extensions/PiranhaHostingExtensions.cs b/core/Piranha.AspNetCore.Hosting/Extensions/PiranhaHostingExtensions.cs index 73c1cce5c..4a06b79ee 100644 --- a/core/Piranha.AspNetCore.Hosting/Extensions/PiranhaHostingExtensions.cs +++ b/core/Piranha.AspNetCore.Hosting/Extensions/PiranhaHostingExtensions.cs @@ -50,6 +50,14 @@ public static IApplicationBuilder UsePiranha(this IApplicationBuilder builder, A options?.Invoke(applicationBuilder); + // Configure all registered endpoints + applicationBuilder.Builder.UseEndpoints(endpoints => + { + foreach (var endpoint in applicationBuilder.Endpoints) + { + endpoint.Invoke(endpoints); + } + }); return applicationBuilder.Builder; } @@ -75,7 +83,7 @@ public static WebApplication UsePiranha(this WebApplication app, Action - { + { foreach (var endpoint in application.Endpoints) { endpoint.Invoke(endpoints);