Skip to content

Class ReferenceDocsHostingOptions

Namespace: Cephalon.AspNetCore.Documentation
Assembly: Cephalon.AspNetCore.dll

Configures how an ASP.NET Core host serves generated Cephalon reference documentation.

public sealed class ReferenceDocsHostingOptions

objectReferenceDocsHostingOptions

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()

These options belong to the host layer rather than the engine core because they describe how already-generated static documentation should be exposed over HTTP.

Creates reference-doc hosting options with the default hosted-doc route settings.

public ReferenceDocsHostingOptions()

Gets the default configuration section used for reference-doc hosting.

public const string SectionName = "ReferenceDocs"

string

Gets or sets the document that should open when a user requests the route prefix itself.

public string DefaultDocument { get; set; }

string

Gets or sets the directory that contains the generated reference-doc output.

public string? DirectoryPath { get; set; }

string?

Relative paths are resolved against the ASP.NET Core content root.

Gets or sets a value indicating whether hosted reference docs should be exposed.

public bool Enabled { get; set; }

bool

Gets or sets the route prefix where the documentation should be served.

public string RoutePrefix { get; set; }

string

The value may be supplied with or without a leading slash. The host normalizes it into a rooted path such as /reference.

FromConfiguration(IConfiguration, string, string?)

Section titled “ FromConfiguration(IConfiguration, string, string?)”

Binds reference-doc hosting options from configuration.

public static ReferenceDocsHostingOptions FromConfiguration(IConfiguration configuration, string sectionPath = "ReferenceDocs", string? contentRootPath = null)

configuration IConfiguration

The application configuration root.

sectionPath string

The section path that contains the hosting settings.

contentRootPath string?

The application content root used to normalize relative documentation paths.

ReferenceDocsHostingOptions

The bound and normalized hosting options.