Condividi tramite


HostingEnvironmentExtensions.IsEnvironment Metodo

Definizione

Confronta il nome dell'ambiente di hosting corrente con il valore specificato.

public:
[System::Runtime::CompilerServices::Extension]
 static bool IsEnvironment(Microsoft::AspNetCore::Hosting::IHostingEnvironment ^ hostingEnvironment, System::String ^ environmentName);
public static bool IsEnvironment (this Microsoft.AspNetCore.Hosting.IHostingEnvironment hostingEnvironment, string environmentName);
static member IsEnvironment : Microsoft.AspNetCore.Hosting.IHostingEnvironment * string -> bool
<Extension()>
Public Function IsEnvironment (hostingEnvironment As IHostingEnvironment, environmentName As String) As Boolean

Parametri

hostingEnvironment
IHostingEnvironment

Istanza di IHostingEnvironment.

environmentName
String

Nome dell'ambiente rispetto al quale eseguire la convalida.

Restituisce

True se il nome specificato corrisponde all'ambiente corrente; in caso contrario, false.

Si applica a