【问题标题】:Intercept an ABase class while a Child class implementing the base class namely A and an independent interface namely IC is used in binding拦截 ABase 类,而实现基类 A 和独立接口 IC 的 Child 类用于绑定
【发布时间】:2011-10-01 10:08:09
【问题描述】:

在实现基类的子类时拦截 ABase 类 即A和一个独立的接口IC用于绑定。

Bind<IC>().To<A>();

当我在 A 中有一个属性将在 代理对象,而在代理对象的实例中有 调试视图中该道具的正确值。

((Ninject.Extensions.Interception.Wrapper.StandardWrapper)
  (((DistributorServiceProxy)(distributorService)).__interceptor)).Instance

确切地说,我将链接添加到要点https://gist.github.com/424637484504b89789d6 包含实际代码。

如果有人可以帮助我,我将非常感激。

干杯, 贾尼

【问题讨论】:

    标签: ninject ninject-extensions ninject.web.mvc ninject-interception


    【解决方案1】:

    只要Repository属性为public就行了;

    【讨论】:

      猜你喜欢
      • 2013-09-30
      • 2016-07-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-03-13
      • 2017-03-01
      相关资源
      最近更新 更多