コード例 #1
0
ファイル: DotEnv.Tests.cs プロジェクト: texyh/dotenv.net
        public void DoesNotThrowExceptionWithNonExistentEnvFileWhenThrowErrorIsFalse()
        {
            var dotEnvOptions = new DotEnvOptions
            {
                Encoding     = Encoding.UTF8,
                ThrowOnError = false,
                EnvFile      = NonExistentEnvFileName,
                TrimValues   = true
            };
            Action action = () => DotEnv.Config(dotEnvOptions);

            action.ShouldNotThrow();
        }
コード例 #2
0
 /// <summary>
 /// Configure the environment variables from a .env file
 /// </summary>
 /// <param name="options">Options on how to load the env file</param>
 public static void Config(DotEnvOptions options)
 {
     Instance.ConfigRunner(options.ThrowOnError, options.EnvFile, options.Encoding, options.TrimValues);
 }
コード例 #3
0
 /// <summary>
 /// Configure the environment variables from a .env file
 /// </summary>
 /// <param name="options">Options on how to load the env file</param>
 public static void Config(DotEnvOptions options)
 {
     Config(options.ThrowOnError, options.EnvFile, options.Encoding);
 }