I am using Ninject 1.5 in my MVC project. It works well, but since we have Ninject 2, I could update (and additionally use behavior for each request that does not work properly in 1.5). Ninject 1.5 had a feature InjectPropertiesWherethat was missing in Ninject 2 (at least that was when I checked it a while ago). Is there something similar?
An example InjectPropertiesWhere:
return Bind<IUserService>().To<UserService>()
.InjectPropertiesWhere(p => p.Name.EndsWith("Repository"))
.InjectPropertiesWhere(p => p.Name.EndsWith("Service"))
.InjectPropertiesWhere(p => p.Name == "ApplicationCache")
.InjectPropertiesWhere(p => p.Name == "CurrentPrincipal")
.InjectPropertiesWhere(p => p.Name == "CTEmailSender")
.InjectPropertiesWhere(p => p.Name == "CTSettings");
source
share