Intercept an ABase class while a Child class implementing the base class namely A and an independent interface namely IC is used in binding

StackOverflow https://stackoverflow.com/questions/7619564

Intercept an ABase class while a Child class implementing the base class namely A and an independent interface namely IC is used in binding.

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

Problem rises when I have a property in A which will be set to null in proxified object, while in the Instance of the proxified object has the right value for that prop in debug view .

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

To be exact I add the link to a gist https://gist.github.com/424637484504b89789d6 containing the actual code.

I will be very grateful if anyone can help me.

Cheers, Jani

有帮助吗?

解决方案

It Just need the Repository property to be public, that's it;

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top