Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
class Microsoft.​Extensions.​Hosting.​HostEnvironmentEnvExtensions
Assembly: Microsoft.Extensions.Hosting.Abstractions
Inheritance: object → HostEnvironmentEnvExtensions
Extension methods for <see cref="T:Microsoft.Extensions.Hosting.IHostEnvironment" /> .
Methods
public static
bool
IsDevelopment​(IHostEnvironment hostEnvironment)
Checks if the current host environment name is <see cref="F:Microsoft.Extensions.Hosting.Environments.Development" /> .
Returns <see langword="true" /> if the environment name is <see cref="F:Microsoft.Extensions.Hosting.Environments.Development" /> , otherwise <see langword="false" /> .
hostEnvironment
An instance of <see cref="T:Microsoft.Extensions.Hosting.IHostEnvironment" /> .
public static
bool
IsEnvironment​(IHostEnvironment hostEnvironment,
string environmentName)
Compares the current host environment name against the specified value.
Returns <see langword="true" /> if the specified name is the same as the current environment, otherwise <see langword="false" /> .
hostEnvironment
An instance of <see cref="T:Microsoft.Extensions.Hosting.IHostEnvironment" /> .
environmentName
Environment name to validate against.
public static
bool
IsProduction​(IHostEnvironment hostEnvironment)
Checks if the current host environment name is <see cref="F:Microsoft.Extensions.Hosting.Environments.Production" /> .
Returns <see langword="true" /> if the environment name is <see cref="F:Microsoft.Extensions.Hosting.Environments.Production" /> , otherwise <see langword="false" /> .
hostEnvironment
An instance of <see cref="T:Microsoft.Extensions.Hosting.IHostEnvironment" /> .
public static
bool
IsStaging​(IHostEnvironment hostEnvironment)
Checks if the current host environment name is <see cref="F:Microsoft.Extensions.Hosting.Environments.Staging" /> .
Returns <see langword="true" /> if the environment name is <see cref="F:Microsoft.Extensions.Hosting.Environments.Staging" /> , otherwise <see langword="false" /> .
hostEnvironment
An instance of <see cref="T:Microsoft.Extensions.Hosting.IHostEnvironment" /> .
public
bool
Equals​(object obj)
Inherited from object
protected
void
Finalize​()
Inherited from object
public
int
GetHashCode​()
Inherited from object
protected
object
MemberwiseClone​()
Inherited from object
public
string
ToString​()
Inherited from object