void ConfigureApp(Container container) { var appSettings = new ConfigurationResourceManager(); string smtpServer= appSettings.Get("MAILGUN_SMTP_SERVER", "localhost"); string smtpLogin= appSettings.Get("MAILGUN_SMTP_LOGIN", "username"); string smtpPassword= appSettings.Get("MAILGUN_SMTP_PASSWORD", "PASSWORD"); int smtpPort= appSettings.Get("MAILGUN_SMTP_PORT", 587); Mailer mailer = new Mailer(smtpServer, smtpPort, smtpLogin, smtpPassword); IRepository rp = new MemRepo(); RepositoryClient rc = new RepositoryClient(rp); Controller controller = new Controller(rc,mailer); controller.InitRepo(); container.Register<Controller>( controller ); }
public Controller (RepositoryClient client, Mailer mailer) { Client= client; Mailer= mailer; LoadRules(); }