绑定:
IKernel kernel = new StandardKernel();
kernel.Bind<ILog>().ToMethod(context => LogManager.GetLogger(context.Request.Target.Type));
kernel.Bind<TSyncService>().ToSelf().Intercept().With<TimingInterceptor>();
ISyncService syncService = kernel.Get<TSyncService>();
消耗:
public class TSyncService:ISyncService
{
ILog log;
public TSyncService(ILog log)
{
this.log = log;
}
问题:
Ninject 无法注入进入动态代理构造函数 'TSyncService(ILog log)'