是否可以在Ninject或任何其他DI框架中启用解决方案范围的依赖关系解决方案?
例如,
// different project, in the same solution :- ProjectLogging
namespace LogProject {
public class Logger {
[Inject]
public ILogImplementation LogImplementation {get;set;}
public void Log(string log, params object[] args){
// .. implementation skipped
}
}
}
// in a different project, in the same solution:- ProjectA
namespace MainProject {
public class Product {
public static void Main(string[] args){
new Logger().Log("Hello");
// some magic here..
var kernel = new StandardKernel(new Bindings());
}
}
}