private void AddBindings() {
            // put additional bindings here
            _ninjectKernel.Bind<IProductRepository>().To<EFProductRepository>();

            // create the email settings object
            var emailSettings = new EmailSettings {
                WriteAsFile 
                    = bool.Parse(ConfigurationManager.AppSettings["Email.WriteAsFile"] ?? "false")
            };

            _ninjectKernel.Bind<IOrderProcessor>()
                .To<EmailOrderProcessor>().WithConstructorArgument("settings", emailSettings);

            _ninjectKernel.Bind<IAuthProvider>().To<FormsAuthProvider>();
        }
Exemplo n.º 2
0
 public EmailOrderProcessor(EmailSettings settings) {
     emailSettings = settings;
 }