public Worker(ILogger <Worker> logger, IConfiguration configuration) { Worker.Logger = logger; Worker.Logger.LogInformation("Folder: " + Directory.GetCurrentDirectory()); repo = new LocalDbRepo.ListRepoContext(); threads = new Dictionary <Guid, Thread>(); var s = new SmtpSettings { EmailSender = configuration.GetValue <string>("SMTP:EmailSender"), Server = configuration.GetValue <string>("SMTP:Server"), Port = configuration.GetValue <int>("SMTP:Port"), Username = configuration.GetValue <string>("SMTP:Username"), SenderPassword = configuration.GetValue <string>("SMTP:Password") }; SmtpClient = new SMTPClient(s); timer = new System.Timers.Timer(); timer.Interval = 10000; timer.Elapsed += Timer_Elapsed;; timer.Start(); }
public App() { Repo = new ListRepoContext(); }