* Run code cleanup * Start manual run * Finish dotnet format + manual cleanup * Fix up after merge * Fix substrings changed to [..] Co-authored-by: Nikolaj Geisle <niko737@edu.ucl.dk> Co-authored-by: Zeegaan <nge@umbraco.dk>
29 lines
870 B
C#
29 lines
870 B
C#
using Microsoft.AspNetCore.Builder;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Umbraco.Cms.Web.BackOffice.Install;
|
|
using Umbraco.Cms.Web.Common.ApplicationBuilder;
|
|
|
|
namespace Umbraco.Extensions;
|
|
|
|
/// <summary>
|
|
/// <see cref="IApplicationBuilder" /> extensions for Umbraco installer
|
|
/// </summary>
|
|
public static partial class UmbracoApplicationBuilderExtensions
|
|
{
|
|
/// <summary>
|
|
/// Enables the Umbraco installer
|
|
/// </summary>
|
|
public static IUmbracoEndpointBuilderContext UseInstallerEndpoints(this IUmbracoEndpointBuilderContext app)
|
|
{
|
|
if (!app.RuntimeState.UmbracoCanBoot())
|
|
{
|
|
return app;
|
|
}
|
|
|
|
InstallAreaRoutes installerRoutes = app.ApplicationServices.GetRequiredService<InstallAreaRoutes>();
|
|
installerRoutes.CreateRoutes(app.EndpointRouteBuilder);
|
|
|
|
return app;
|
|
}
|
|
}
|