public FileManager(DatetimeManager datetimeManager) { Start = datetimeManager.Now(); Index = 0; IConfiguration config = new ConfigurationBuilder() .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) .AddEnvironmentVariables() .Build(); BaseFolder = new DirectoryInfo(config["logFolder"]); if (!BaseFolder.Exists) { BaseFolder.Create(); } Order = 1; }
public FileManager(DatetimeManager datetimeManager) { Start = datetimeManager.Now(); IConfiguration config = new ConfigurationBuilder() .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) .AddEnvironmentVariables() .Build(); ConfigFodler = config["logFolder"] ?? "logs"; if (!Path.IsPathRooted(ConfigFodler)) { ConfigFodler = Path.Combine( new FileInfo(this.GetType().Assembly.Location).DirectoryName, ConfigFodler); } Order = 1; }