Пример #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>();

            var settings = new EmailSettings()
            {
                WriteAsFile = 
                bool.Parse(ConfigurationManager.AppSettings["email.writeAsFile"])
            };

            kernel.Bind<IOrderProcessor>()
                .To<EmailOrderProcessor>()
                .WithConstructorArgument("settings",settings);            
        }        
 public EmailOrderProcessor(EmailSettings settings)
 {
     _settings = settings;
 }