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

CompiledAssemblyApiMetadataExtensions Pennington.ApiMetadata.Reflection

DI extension that registers a reflection-backed IApiMetadataProvider.

Methods

AddApiMetadataFromCompiledAssembly

#
public static IServiceCollection AddApiMetadataFromCompiledAssembly(IServiceCollection services, string name, Action<CompiledAssemblyApiOptions> configure)

Registers CompiledAssemblyApiMetadataProvider as a keyed IApiMetadataProvider under name. Call once per library you want to document — each call builds its own MetadataLoadContext and xmldoc index scoped to the supplied AssemblyDirectories. The shared IXmlDocParser / IXmlDocHtmlRenderer services are registered once (idempotent).

Parameters

services IServiceCollection
Service collection.
name string
Registration name. Pair with the matching AddApiReference(name, …) call. Defaults to "default".
configure Action<CompiledAssemblyApiOptions>
Required configuration — at minimum add one entry to AssemblyDirectories.

Returns

IServiceCollection

AddApiMetadataFromCompiledAssembly

#
public static IServiceCollection AddApiMetadataFromCompiledAssembly(IServiceCollection services, Action<CompiledAssemblyApiOptions> configure)

Convenience overload: registers under the "default" name for sites documenting a single library.

Parameters

services IServiceCollection
configure Action<CompiledAssemblyApiOptions>

Returns

IServiceCollection

Pennington.ApiMetadata.Reflection.CompiledAssemblyApiMetadataExtensions

namespace Pennington.ApiMetadata.Reflection;

/// DI extension that registers a reflection-backed IApiMetadataProvider.
public class CompiledAssemblyApiMetadataExtensions
{
    /// Registers CompiledAssemblyApiMetadataProvider as a keyed IApiMetadataProvider under name. Call once per library you want to document — each call builds its own MetadataLoadContext and xmldoc index scoped to the supplied AssemblyDirectories. The shared IXmlDocParser / IXmlDocHtmlRenderer services are registered once (idempotent).
    
public static IServiceCollection AddApiMetadataFromCompiledAssembly(IServiceCollection services, string name, Action<CompiledAssemblyApiOptions> configure)
; /// Convenience overload: registers under the "default" name for sites documenting a single library.
public static IServiceCollection AddApiMetadataFromCompiledAssembly(IServiceCollection services, Action<CompiledAssemblyApiOptions> configure)
; }