HostingEnvironmentExtensions.IsEnvironment Methode

Definition

Vergleicht den Namen der aktuellen Hostumgebung mit dem angegebenen Wert.

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

Parameter

hostingEnvironment
IHostingEnvironment

Eine Instanz von IHostingEnvironment.

environmentName
String

Der Umgebungsname, mit dem die Überprüfung stattfindet.

Gibt zurück

True, wenn der angegebene Name mit der aktuellen Umgebung identisch ist, andernfalls false.

Gilt für: