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 ReferenceDocsHostingOptionsInheritance
Section titled “Inheritance”object ← ReferenceDocsHostingOptions
Inherited Members
Section titled “Inherited Members”object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()
Remarks
Section titled “Remarks”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.
Constructors
Section titled “Constructors”ReferenceDocsHostingOptions()
Section titled “ ReferenceDocsHostingOptions()”Creates reference-doc hosting options with the default hosted-doc route settings.
public ReferenceDocsHostingOptions()Fields
Section titled “Fields”SectionName
Section titled “ SectionName”Gets the default configuration section used for reference-doc hosting.
public const string SectionName = "ReferenceDocs"Field Value
Section titled “Field Value”Properties
Section titled “Properties”DefaultDocument
Section titled “ DefaultDocument”Gets or sets the document that should open when a user requests the route prefix itself.
public string DefaultDocument { get; set; }Property Value
Section titled “Property Value”DirectoryPath
Section titled “ DirectoryPath”Gets or sets the directory that contains the generated reference-doc output.
public string? DirectoryPath { get; set; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”Relative paths are resolved against the ASP.NET Core content root.
Enabled
Section titled “ Enabled”Gets or sets a value indicating whether hosted reference docs should be exposed.
public bool Enabled { get; set; }Property Value
Section titled “Property Value”RoutePrefix
Section titled “ RoutePrefix”Gets or sets the route prefix where the documentation should be served.
public string RoutePrefix { get; set; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”The value may be supplied with or without a leading slash. The host normalizes it into a
rooted path such as /reference.
Methods
Section titled “Methods”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)Parameters
Section titled “Parameters”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.
Returns
Section titled “Returns”The bound and normalized hosting options.