コード例 #1
0
        /// <summary>
        /// Load your modules or register your services here!
        /// </summary>
        /// <param name="kernel">The kernel.</param>
        private static void RegisterServices(IKernel kernel)
        {
            kernel.Bind<IProductRepository>().To<EFProductRepository>();

            EmailSettings emailSettings = new EmailSettings() { WriteAsFile = bool.Parse(ConfigurationManager.AppSettings["Email.WriteAsFile"] ?? "false") };

            kernel.Bind<IOrderProcessor>().To<EmailOrderProcessor>().WithConstructorArgument(
                "settings", emailSettings);
        }
コード例 #2
0
 public EmailOrderProcessor(EmailSettings settings)
 {
     this.emailSettings = settings;
 }