3

绑定:

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)'

4

0 回答 0