HostEnvironmentEnvExtensions.IsStaging(IHostEnvironment) 方法

定义

检查当前主机环境名称是否为 StagingChecks if the current host environment name is Staging. 此 API 不应在库中使用。有关详细信息,请参阅注解。This API should not be used in libraries, see remarks for details.

public:
[System::Runtime::CompilerServices::Extension]
 static bool IsStaging(Microsoft::Extensions::Hosting::IHostEnvironment ^ hostEnvironment);
public static bool IsStaging (this Microsoft.Extensions.Hosting.IHostEnvironment hostEnvironment);
static member IsStaging : Microsoft.Extensions.Hosting.IHostEnvironment -> bool
<Extension()>
Public Function IsStaging (hostEnvironment As IHostEnvironment) As Boolean

参数

hostEnvironment
IHostEnvironment

IHostEnvironment 的一个实例。An instance of IHostEnvironment.

返回

Boolean

如果环境名称为 Staging,则为 true;否则为 falsetrue if the environment name is Staging; otherwise, false.

注解

环境名称 "开发"、"生产" 和 "过渡" 作为应用程序开发人员的实用程序提供。The environment names "Development", "Production" and "Staging" are provided as a utility for application developers. 库作者应避免将特定行为耦合到这些环境名称。Library authors should avoid coupling specific behavior to these environment names.

适用于