Method Load
| Improve this Doc View SourceLoad(out EnvValidationResult)
Loads one or more .env files. By default, it will search for a file called .env
.
Declaration
IEnvironmentVariablesProvider Load(out EnvValidationResult result)
Parameters
Type | Name | Description |
---|---|---|
EnvValidationResult | result | The result contains the errors found by the loader. |
Returns
Type | Description |
---|---|
IEnvironmentVariablesProvider | An instance representing the provider of environment variables. |
Remarks
This method starts find the .env file in the current directory and if it does not found it, it starts find in the parent directories of the current directory.
Exceptions
Type | Condition |
---|---|
ParserException | If the parser encounters one or more errors. This exception is not thrown if the IgnoreParserException() method is invoked. |
FileNotFoundException | If the .env files are not found. This exception is only thrown if the EnableFileNotFoundException() method is invoked. |
Load()
Loads one or more .env files. By default, it will search for a file called .env
.
Declaration
IEnvironmentVariablesProvider Load()
Returns
Type | Description |
---|---|
IEnvironmentVariablesProvider | An instance representing the provider of environment variables. |
Remarks
This method starts find the .env file in the current directory and if it does not found it, it starts find in the parent directories of the current directory.
Exceptions
Type | Condition |
---|---|
ParserException | If the parser encounters one or more errors. This exception is not thrown if the IgnoreParserException() method is invoked. |
FileNotFoundException | If the .env files are not found. This exception is only thrown if the EnableFileNotFoundException() method is invoked. |