HostAttribute 類別

定義

提供路由期間使用的主機 metdata 屬性。

public ref class HostAttribute sealed : Attribute, Microsoft::AspNetCore::Routing::IHostMetadata
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=false, Inherited=false)]
public sealed class HostAttribute : Attribute, Microsoft.AspNetCore.Routing.IHostMetadata
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=false, Inherited=false)>]
type HostAttribute = class
    inherit Attribute
    interface IHostMetadata
Public NotInheritable Class HostAttribute
Inherits Attribute
Implements IHostMetadata
繼承
HostAttribute
屬性
實作

建構函式

HostAttribute(String)

初始化 HostAttribute 類別的新執行個體。

HostAttribute(String[])

初始化 HostAttribute 類別的新執行個體。

屬性

Hosts

傳回路由期間使用的主機唯讀集合。 主機會是 Unicode,而不是 punycode,而且可能有埠。 空集合表示將接受任何主機。

方法

ToString()

提供路由期間使用的主機 metdata 屬性。

適用於