This documentation is also published as Markdown for efficient machine reading: the whole site is indexed at /llms.txt, and every page has a clean Markdown copy under /_llms/. These are generated from the same source and cost far fewer tokens to read than this rendered HTML.

Skip to main content Skip to navigation

ContentRendererServiceExtensions Pennington.Pipeline

DI helpers for swapping the registered IContentRenderer.

Methods

ReplaceContentRenderer<TOld, TNew>

#
public static IServiceCollection ReplaceContentRenderer<TOld, TNew>(IServiceCollection services)

Replaces every registered IContentRenderer with TNew, resolved through DI as a transient. The TOld type parameter documents the renderer being swapped out — it is informational and unused at runtime, but lets the call site read as "replace TOld with TNew".

Parameters

services IServiceCollection

Returns

IServiceCollection

ReplaceContentRenderer<TOld, TNew>

#
public static IServiceCollection ReplaceContentRenderer<TOld, TNew>(IServiceCollection services, Func<IServiceProvider, TNew> factory)

Replaces every registered IContentRenderer with one produced by factory. Use this overload when the new renderer takes ctor arguments DI cannot resolve (e.g. a version string or per-site constant).

Parameters

services IServiceCollection
factory Func<IServiceProvider, TNew>

Returns

IServiceCollection

Pennington.Pipeline.ContentRendererServiceExtensions

namespace Pennington.Pipeline;

/// DI helpers for swapping the registered IContentRenderer.
public class ContentRendererServiceExtensions
{
    /// Replaces every registered IContentRenderer with TNew, resolved through DI as a transient. The TOld type parameter documents the renderer being swapped out — it is informational and unused at runtime, but lets the call site read as "replace TOld with TNew".
    
public static IServiceCollection ReplaceContentRenderer<TOld, TNew>(IServiceCollection services)
; /// Replaces every registered IContentRenderer with one produced by factory. Use this overload when the new renderer takes ctor arguments DI cannot resolve (e.g. a version string or per-site constant).
public static IServiceCollection ReplaceContentRenderer<TOld, TNew>(IServiceCollection services, Func<IServiceProvider, TNew> factory)
; }