Skip to content

Environment Features

Tricklebyte edited this page Jan 13, 2020 · 1 revision

IHostEnvironmentExtensions Class


Namespace: ConfigCore.Extensions
Assembly: ConfigCore.Dll

Extension methods for IHostEnvironment check for environments, QA, Local, and Test.

IsLocal(IHostEnvironment)

Checks if the current host Environment name is "Local"

public static bool IsLocal(this IHostEnvironment hostEnvironment)

Parameters

hostEnvironment IHostEnvironment
An instance of IHostEnvironment

Returns

Boolean


IsTest(IHostEnvironment)

Checks if the current host Environment name is "Test"

public static bool IsTest(this IHostEnvironment hostEnvironment)

Parameters

hostEnvironment IHostEnvironment
An instance of IHostEnvironment

Returns

Boolean


IsQA(IHostEnvironment)

Checks if the current host Environment name is "QA"

public static bool IsQA(this IHostEnvironment hostEnvironment)

Parameters

hostEnvironment IHostEnvironment
An instance of IHostEnvironment

Returns

Boolean