Example #1
0
        public static IUmbracoEndpointBuilderContext UseUmbracoPreviewEndpoints(this IUmbracoEndpointBuilderContext app)
        {
            PreviewRoutes previewRoutes = app.ApplicationServices.GetRequiredService <PreviewRoutes>();

            previewRoutes.CreateRoutes(app.EndpointRouteBuilder);

            return(app);
        }
Example #2
0
    /// <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);
    }
Example #3
0
    /// <summary>
    ///     Enables runtime minification for Umbraco
    /// </summary>
    public static IUmbracoEndpointBuilderContext UseUmbracoRuntimeMinificationEndpoints(
        this IUmbracoEndpointBuilderContext app)
    {
        if (app == null)
        {
            throw new ArgumentNullException(nameof(app));
        }

        if (!app.RuntimeState.UmbracoCanBoot())
        {
            return(app);
        }

        app.AppBuilder.UseSmidge();
        app.AppBuilder.UseSmidgeNuglify();

        return(app);
    }
Example #4
0
    /// <summary>
    ///     Sets up routes for the front-end umbraco website
    /// </summary>
    public static IUmbracoEndpointBuilderContext UseWebsiteEndpoints(this IUmbracoEndpointBuilderContext builder)
    {
        if (builder == null)
        {
            throw new ArgumentNullException(nameof(builder));
        }

        if (!builder.RuntimeState.UmbracoCanBoot())
        {
            return(builder);
        }

        FrontEndRoutes surfaceRoutes = builder.ApplicationServices.GetRequiredService <FrontEndRoutes>();

        surfaceRoutes.CreateRoutes(builder.EndpointRouteBuilder);
        builder.EndpointRouteBuilder.MapDynamicControllerRoute <UmbracoRouteValueTransformer>("/{**slug}");

        return(builder);
    }
    public static IUmbracoEndpointBuilderContext UseBackOfficeEndpoints(this IUmbracoEndpointBuilderContext app)
    {
        // NOTE: This method will have been called after UseRouting, UseAuthentication, UseAuthorization
        if (app == null)
        {
            throw new ArgumentNullException(nameof(app));
        }

        if (!app.RuntimeState.UmbracoCanBoot())
        {
            return(app);
        }

        BackOfficeAreaRoutes backOfficeRoutes = app.ApplicationServices.GetRequiredService <BackOfficeAreaRoutes>();

        backOfficeRoutes.CreateRoutes(app.EndpointRouteBuilder);

        app.UseUmbracoRuntimeMinificationEndpoints();
        app.UseUmbracoPreviewEndpoints();

        return(app);
    }
        public static IUmbracoEndpointBuilderContext UsePersonalisationGroupsEndpoints(this IUmbracoEndpointBuilderContext builderContext)
        {
            builderContext.EndpointRouteBuilder.MapControllerRoute(
                name: "Criteria methods",
                pattern: "App_Plugins/PersonalisationGroups/Criteria",
                defaults: new { controller = "Criteria", action = "Index" });
            builderContext.EndpointRouteBuilder.MapControllerRoute(
                name: "Geo location methods",
                pattern: "App_Plugins/PersonalisationGroups/GeoLocation/{action}",
                defaults: new { controller = "GeoLocation", action = "Index" });
            builderContext.EndpointRouteBuilder.MapControllerRoute(
                name: "Member methods",
                pattern: "App_Plugins/PersonalisationGroups/Member/{action}",
                defaults: new { controller = "Member", action = "Index" });

            return(builderContext);
        }