Compartilhar via


HostingEnvironmentExtensions.IsEnvironment Método

Definição

Compara o nome do ambiente de hospedagem atual com o 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

Uma instância de IHostingEnvironment.

environmentName
String

Nome do ambiente a ser validado.

Retornos

True se o nome especificado for o mesmo que o ambiente atual; caso contrário, false.

Aplica-se a