Esempio n. 1
0
    /// <summary>
    /// Simple startup with integrated middleware that also adds common
    /// dependencies needed for an integrated web application.
    /// </summary>
    /// <param name="builder">The application builder</param>
    /// <param name="options">Action for configuring the builder</param>
    /// <returns>The updated application builder</returns>
    public static IApplicationBuilder UsePiranha(this IApplicationBuilder builder, Action <PiranhaApplicationBuilder> options)
    {
        var applicationBuilder = new PiranhaApplicationBuilder(builder);

        applicationBuilder.Builder
        .UseRouting()
        .UseAuthentication()
        .UseAuthorization();

        options?.Invoke(applicationBuilder);

        return(applicationBuilder.Builder);
    }
Esempio n. 2
0
    /// <summary>
    /// Uses the Piranha Manager if simple startup is enabled.
    /// </summary>
    /// <param name="applicationBuilder">The application builder</param>
    /// <returns>The updated builder</returns>
    public static PiranhaApplicationBuilder UseManager(this PiranhaApplicationBuilder applicationBuilder)
    {
        applicationBuilder.Builder.UsePiranhaManager();
        applicationBuilder.Builder.UseEndpoints(endpoints =>
        {
            endpoints.MapControllerRoute(
                name: "default",
                pattern: "{controller=Home}/{action=Index}/{id?}");

            endpoints.MapPiranhaManager();
        });

        return(applicationBuilder);
    }
Esempio n. 3
0
    /// <summary>
    /// Simple startup with integrated middleware that also adds common
    /// dependencies needed for an integrated web application.
    /// </summary>
    /// <param name="builder">The application builder</param>
    /// <param name="options">Action for configuring the builder</param>
    /// <returns>The updated application builder</returns>
    public static IApplicationBuilder UsePiranha(this IApplicationBuilder builder, Action <PiranhaApplicationBuilder> options)
    {
        var piranhaOptions = new PiranhaApplicationBuilder(builder);

        piranhaOptions.Builder
        .UseStaticFiles()
        .UseIntegratedPiranha()
        .UsePiranhaSitemap()
        .UseRouting()
        .UseAuthentication()
        .UseAuthorization();

        options?.Invoke(piranhaOptions);

        return(piranhaOptions.Builder);
    }
Esempio n. 4
0
    /// <summary>
    /// Simple startup with integrated middleware that also adds common
    /// dependencies needed for an integrated web application.
    /// </summary>
    /// <param name="builder">The application builder</param>
    /// <param name="options">Action for configuring the builder</param>
    /// <returns>The updated application builder</returns>
    public static IApplicationBuilder UsePiranha(this IApplicationBuilder builder, Action <PiranhaApplicationBuilder> options)
    {
        var piranhaOptions = new PiranhaApplicationBuilder(builder);

        piranhaOptions.Builder
        .UseSecurityMiddleware()
        .UseStaticFiles()
        .UseMiddleware <Piranha.AspNetCore.PiranhaMiddleware>()
        .UseMiddleware <Piranha.AspNetCore.SitemapMiddleware>()
        .UseRouting()
        .UseAuthentication()
        .UseAuthorization();

        options?.Invoke(piranhaOptions);

        return(piranhaOptions.Builder);
    }
    /// <summary>
    /// Simple startup with integrated middleware that also adds common
    /// dependencies needed for an integrated web application.
    /// </summary>
    /// <param name="builder">The application builder</param>
    /// <param name="options">Action for configuring the builder</param>
    /// <returns>The updated application builder</returns>
    public static IApplicationBuilder UsePiranha(this IApplicationBuilder builder, Action <PiranhaApplicationBuilder> options)
    {
        var applicationBuilder = new PiranhaApplicationBuilder(builder);

        applicationBuilder.Builder
        .UseRouting()
        .UseAuthentication()
        .UseAuthorization();

        options?.Invoke(applicationBuilder);

        // Configure all registered endpoints
        applicationBuilder.Builder.UseEndpoints(endpoints =>
        {
            foreach (var endpoint in applicationBuilder.Endpoints)
            {
                endpoint.Invoke(endpoints);
            }
        });
        return(applicationBuilder.Builder);
    }
    /// <summary>
    /// Uses the Tiny MCE editor module if simple startup is used.
    /// </summary>
    /// <param name="applicationBuilder">The application builder</param>
    /// <returns>The updated builder</returns>
    public static PiranhaApplicationBuilder UseTinyMCE(this PiranhaApplicationBuilder applicationBuilder)
    {
        applicationBuilder.Builder.UsePiranhaTinyMCE();

        return(applicationBuilder);
    }
    /// <summary>
    /// Uses the Piranha identity module.
    /// </summary>
    /// <param name="applicationBuilder">The current application builder</param>
    /// <returns>The builder</returns>
    public static PiranhaApplicationBuilder UseIdentity(this PiranhaApplicationBuilder applicationBuilder)
    {
        applicationBuilder.Builder.UsePiranhaIdentity();

        return(applicationBuilder);
    }
    /// <summary>
    /// Uses the Summernote editor module if simple startup is used.
    /// </summary>
    /// <param name="applicationBuilder">The application builder</param>
    /// <returns>The updated builder</returns>
    public static PiranhaApplicationBuilder UseSummernote(this PiranhaApplicationBuilder applicationBuilder)
    {
        applicationBuilder.Builder.UsePiranhaSummernote();

        return(applicationBuilder);
    }
    /// <summary>
    /// Uses the TemplateModule module.
    /// </summary>
    /// <param name="applicationBuilder">The current application builder</param>
    /// <returns>The builder</returns>
    public static PiranhaApplicationBuilder UseTemplateModule(this PiranhaApplicationBuilder applicationBuilder)
    {
        applicationBuilder.Builder.UseTemplateModule();

        return(applicationBuilder);
    }
        /// <summary>
        /// Uses the SpamDetectorService if simple startup is used.
        /// </summary>
        /// <param name="applicationBuilder">The application builder</param>
        /// <returns>The updated builder</returns>
        public static PiranhaApplicationBuilder UseSpamDetector(this PiranhaApplicationBuilder applicationBuilder)
        {
            applicationBuilder.Builder.UseSpamDetector();

            return(applicationBuilder);
        }