using Microsoft.AspNetCore.Routing;
using Umbraco.Cms.Core;
using Umbraco.Cms.Web.BackOffice.Install;
namespace Umbraco.Extensions;
public static class BackofficeLinkGeneratorExtensions
{
///
/// Returns the URL for the installer
///
public static string? GetInstallerUrl(this LinkGenerator linkGenerator)
=> linkGenerator.GetPathByAction(nameof(InstallController.Index), ControllerExtensions.GetControllerName(), new { area = Constants.Web.Mvc.InstallArea });
///
/// Returns the URL for the installer api
///
public static string? GetInstallerApiUrl(this LinkGenerator linkGenerator)
=> linkGenerator.GetPathByAction(
nameof(InstallApiController.GetSetup),
ControllerExtensions.GetControllerName(),
new { area = Constants.Web.Mvc.InstallArea })?.TrimEnd(nameof(InstallApiController.GetSetup));
}