This site provides a machine-readable index at /llms.txt.

Skip to main content Skip to navigation

PenningtonExtensions Pennington.Infrastructure

DI and pipeline extensions that wire Pennington services into an ASP.NET Core host.

Methods

AddPennington

#
public static IServiceCollection AddPennington(this IServiceCollection services, Action<PenningtonOptions> configure);

Register all Pennington services.

Parameters

services IServiceCollection
configure Action<PenningtonOptions>

Returns

IServiceCollection

RunOrBuildAsync

#
public static async Task RunOrBuildAsync(this WebApplication app, string[] args);

Run in dev mode or build static site.

Parameters

app WebApplication
args string[]

Returns

Task

UsePennington

#
public static WebApplication UsePennington(this WebApplication app);

Configure the Pennington middleware pipeline.

Parameters

app WebApplication

Returns

WebApplication

UsePenningtonLocaleRouting

#
public static WebApplication UsePenningtonLocaleRouting(this WebApplication app);

Adds locale detection and URL path rewriting middleware. Must be called MapRazorComponents so that Blazor routing sees the locale-stripped path (e.g., /gen-z/schedule becomes /schedule).

Called automatically by UsePennington when it hasn't been called yet, but at that point it is too late for Blazor endpoint routing. Sites that use @page directives with locale prefixes must call this explicitly.

Parameters

app WebApplication

Returns

WebApplication

Pennington.Infrastructure.PenningtonExtensions

namespace Pennington.Infrastructure;

/// DI and pipeline extensions that wire Pennington services into an ASP.NET Core host.
public class PenningtonExtensions
{
    /// Register all Pennington services.
    
public static IServiceCollection AddPennington(this IServiceCollection services, Action<PenningtonOptions> configure);
/// Run in dev mode or build static site.
public static async Task RunOrBuildAsync(this WebApplication app, string[] args);
/// Configure the Pennington middleware pipeline.
public static WebApplication UsePennington(this WebApplication app);
/// Adds locale detection and URL path rewriting middleware. Must be called MapRazorComponents so that Blazor routing sees the locale-stripped path (e.g., /gen-z/schedule becomes /schedule). Called automatically by UsePennington when it hasn't been called yet, but at that point it is too late for Blazor endpoint routing. Sites that use @page directives with locale prefixes must call this explicitly.
public static WebApplication UsePenningtonLocaleRouting(this WebApplication app);
}