示例#1
0
 /// <summary>
 /// Load your modules or register your services here!
 /// </summary>
 /// <param name="kernel">The kernel.</param>
 private static void RegisterServices(IKernel kernel)
 {
     EmailSettings emailSettings = new EmailSettings
     {
         ServerName = Settings.Default.EmailServerName,
         ServerPort = Settings.Default.EmailServerPort,
         UseSsl = Settings.Default.EmailUseSsl,
         Username = Settings.Default.EmailUsername,
         Password = Settings.Default.EmailPassword
     };
     kernel.Bind<IEmailSender>().To<EmailSender>().WithConstructorArgument("settings", emailSettings);
     kernel.Bind<DbContext>().To<ApplicationDbContext>().InRequestScope();
     kernel.Bind<IUowData>().To<UowData>().InRequestScope();
 }
示例#2
0
 public EmailSender(EmailSettings settings)
 {
     EmailSettings = settings;
 }