private void AddBindings() { // put bindings here //Mock<IProductRepository> mock = new Mock<IProductRepository>(); //mock.Setup(m => m.Products).Returns(new List<Product> //{ // new Product { Name = "Football", Price = 25 }, // new Product { Name = "Surf board", Price = 179 }, // new Product { Name = "Running shoes", Price = 95 } //}); //kernel.Bind<IProductRepository>().ToConstant(mock.Object); kernel.Bind<IProductRepository>().To<MongoProductRepository>(); kernel.Bind<IUserRepository>().To<MongoUserRepository>(); EmailSettings emailSettings = new EmailSettings { WriteAsFile = bool.Parse(ConfigurationManager.AppSettings["Email.WriteAsFile"] ?? "false") }; kernel.Bind<IOrderProcessor>().To<EmailOrderProcessor>().WithConstructorArgument("settings", emailSettings); kernel.Bind<IAuthProvider>().To<BcryptAuthProvider>(); }
public EmailOrderProcessor(EmailSettings settings) { emailSettings = settings; }
public EmailOrderProcessor(EmailSettings emailSettings) { _emailSettings = emailSettings; }