private void AddBindings() { kernel.Bind<IProductRepository>().To<EFProductRepository>(); kernel.Bind<ICategoryRepository>().To<EFCategoryRepository>(); kernel.Bind<ICustomerRepository>().To<EFCustomerRepository>(); kernel.Bind<IAddressRepository>().To<EFAddressRepository>(); kernel.Bind<IOrderRepository>().To<EFOrderRepository>(); kernel.Bind<IOrderItemRepository>().To<EFOrderItemRepository>(); EmailSettings emailSettings = new EmailSettings { WriteAsFile = bool.Parse(ConfigurationManager .AppSettings["Email.WriteAsFile"] ?? "false") }; kernel.Bind<IOrderProcessor>().To<EmailOrderProcessor>() .WithConstructorArgument("settings", emailSettings); }
public EmailOrderProcessor(EmailSettings settings) { emailSettings = settings; }