File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ public static class ApplicationEnvironment
1818 // ReSharper disable once InconsistentNaming
1919 public const string DefaultEnvironmentName = "Production" ;
2020
21- private static string _name = Environment . GetEnvironmentVariable ( EnvironmentVariableName ) ?? DefaultEnvironmentName ;
21+ private static string ? _name ;
2222
2323 /// <summary>
2424 /// Gets or sets the current environment name.
@@ -28,7 +28,7 @@ public static class ApplicationEnvironment
2828 /// </value>
2929 public static string Name
3030 {
31- get => _name ;
31+ get { return _name ??= Environment . GetEnvironmentVariable ( EnvironmentVariableName ) ?? DefaultEnvironmentName ; }
3232 set => _name = value ?? throw new ArgumentNullException ( nameof ( value ) ) ;
3333 }
3434 }
You can’t perform that action at this time.
0 commit comments