Compartir a través de


HostingEnvironmentExtensions.IsEnvironment Método

Definición

Compara el nombre del entorno de hospedaje actual con el valor especificado.

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

Parámetros

hostingEnvironment
IHostingEnvironment

Instancia de IHostingEnvironment.

environmentName
String

Nombre del entorno sobre el que se va a validar.

Devoluciones

True si el nombre especificado es el mismo que el entorno actual; de lo contrario, false.

Se aplica a