Search Results for

    Show / Hide Table of Contents

    Method AddEnvFile

    | Improve this Doc View Source

    AddEnvFile(String)

    Adds an .env file in a collection.

    Declaration
    IEnvLoader AddEnvFile(string path)
    Parameters
    Type Name Description
    String path

    The .env file path to add.

    Returns
    Type Description
    IEnvLoader

    An instance implementing the fluent interface.

    Exceptions
    Type Condition
    ArgumentNullException

    path is null.

    | Improve this Doc View Source

    AddEnvFile(String, Encoding)

    Adds an .env file with its encoding in a collection.

    Declaration
    IEnvLoader AddEnvFile(string path, Encoding encoding)
    Parameters
    Type Name Description
    String path

    The .env file path to add.

    Encoding encoding

    The encoding of the .env file.

    Returns
    Type Description
    IEnvLoader

    An instance implementing the fluent interface.

    Exceptions
    Type Condition
    ArgumentNullException

    path is null.

    | Improve this Doc View Source

    AddEnvFile(String, Encoding, Boolean)

    Adds an .env file with its encoding in a collection.

    Declaration
    IEnvLoader AddEnvFile(string path, Encoding encoding, bool optional)
    Parameters
    Type Name Description
    String path

    The .env file path to add.

    Encoding encoding

    The encoding of the .env file.

    Boolean optional

    The value indicating whether the existence of the .env file is optional, or not.

    Returns
    Type Description
    IEnvLoader

    An instance implementing the fluent interface.

    Exceptions
    Type Condition
    ArgumentNullException

    path is null.

    | Improve this Doc View Source

    AddEnvFile(String, String)

    Adds an .env file with its encoding name in a collection.

    Declaration
    IEnvLoader AddEnvFile(string path, string encodingName)
    Parameters
    Type Name Description
    String path

    The .env file path to add.

    String encodingName

    The encoding name of the .env file.

    Returns
    Type Description
    IEnvLoader

    An instance implementing the fluent interface.

    Exceptions
    Type Condition
    ArgumentNullException

    path, or encodingName is null.

    ArgumentException

    encodingName is not a valid code page name or is not supported by the underlying platform.

    | Improve this Doc View Source

    AddEnvFile(String, String, Boolean)

    Adds an .env file with its encoding name in a collection.

    Declaration
    IEnvLoader AddEnvFile(string path, string encodingName, bool optional)
    Parameters
    Type Name Description
    String path

    The .env file path to add.

    String encodingName

    The encoding name of the .env file.

    Boolean optional

    The value indicating whether the existence of the .env file is optional, or not.

    Returns
    Type Description
    IEnvLoader

    An instance implementing the fluent interface.

    Exceptions
    Type Condition
    ArgumentNullException

    path, or encodingName is null.

    ArgumentException

    encodingName is not a valid code page name or is not supported by the underlying platform.

    | Improve this Doc View Source

    AddEnvFile(String, Boolean)

    Adds an .env file to a collection and indicates whether the .env file can be optional, or not.

    Declaration
    IEnvLoader AddEnvFile(string path, bool optional)
    Parameters
    Type Name Description
    String path

    The .env file path to add.

    Boolean optional

    The value indicating whether the existence of the .env file is optional, or not.

    Returns
    Type Description
    IEnvLoader

    An instance implementing the fluent interface.

    Exceptions
    Type Condition
    ArgumentNullException

    path is null.

    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright ©2021 DotEnv.Core