RoutingEndpointConventionBuilderExtensions.RequireHost<TBuilder> Metoda

Definicja

Wymaga, aby punkty końcowe odpowiadały jednemu z określonych hostów podczas routingu.

public:
generic <typename TBuilder>
 where TBuilder : Microsoft::AspNetCore::Builder::IEndpointConventionBuilder[System::Runtime::CompilerServices::Extension]
 static TBuilder RequireHost(TBuilder builder, ... cli::array <System::String ^> ^ hosts);
public static TBuilder RequireHost<TBuilder> (this TBuilder builder, params string[] hosts) where TBuilder : Microsoft.AspNetCore.Builder.IEndpointConventionBuilder;
static member RequireHost : 'Builder * string[] -> 'Builder (requires 'Builder :> Microsoft.AspNetCore.Builder.IEndpointConventionBuilder)
<Extension()>
Public Function RequireHost(Of TBuilder As IEndpointConventionBuilder) (builder As TBuilder, ParamArray hosts As String()) As TBuilder

Parametry typu

TBuilder

Parametry

builder
TBuilder

Element IEndpointConventionBuilder do dodawania metadanych.

hosts
String[]

Hosty używane podczas routingu. Hosty powinny być unicode, a nie punycode i mogą mieć port. Pusta kolekcja oznacza, że każdy host zostanie zaakceptowany.

Zwraca

TBuilder

Odwołanie do tego wystąpienia po zakończeniu operacji.

Dotyczy