HostAttribute Class

Definition

Attribute for providing host metdata that is used during routing.

C#
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=false, Inherited=false)]
public sealed class HostAttribute : Attribute, Microsoft.AspNetCore.Routing.IHostMetadata
Inheritance
HostAttribute
Attributes
Implements

Constructors

HostAttribute(String)

Initializes a new instance of the HostAttribute class.

HostAttribute(String[])

Initializes a new instance of the HostAttribute class.

Properties

Hosts

Returns a read-only collection of hosts used during routing. Hosts will be Unicode rather than punycode, and may have a port. An empty collection means any host will be accepted.

Methods

ToString() System.Attribute.ToString

Applies to

Produk Versi
ASP.NET Core 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0