Ninject.Extensions.Interception拦截参数构造函数

时间:2013-03-18 09:28:42

标签: c# constructor ninject

绑定:

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

0 个答案:

没有答案