HostingEnvironmentExtensions.IsProduction(IHostingEnvironment) 方法

定义

检查当前主机环境名称是否为 Production

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

参数

hostingEnvironment
IHostingEnvironment

IHostingEnvironment 的一个实例。

返回

如果环境名称为 ,则 Production为 True,否则为 false。

适用于