Share via


HostingEnvironmentExtensions.IsProduction(IHostingEnvironment) Méthode

Définition

Vérifie si le nom de l’environnement d’hébergement actuel est Production. Cette API ne doit pas être utilisée dans les bibliothèques. Pour plus d’informations, consultez les remarques.

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

Paramètres

hostingEnvironment
IHostingEnvironment

Instance de IHostingEnvironment.

Retours

true si le nom de l’environnement est Production ; sinon, false.

Remarques

Les noms d’environnement « Développement », « Production » et « Préproduction » sont fournis en tant qu’utilitaire pour les développeurs d’applications. Les auteurs de bibliothèques doivent éviter de coupler un comportement spécifique à ces noms d’environnement.

S’applique à