Im looking for a way to always intercept an instance of a specific class as soon as its properties are used..
For instance if MyTestClass would be intercepted..this would trigger the interception:
var myObj = new MyTestClass();
var x = myObj.SomeProperty;
that would then intercept the method "get_SomeProperty".. however all the examples that I have seen using Unity requires me to "pipe" the creation of the instance of MyTestClass through container.Resolve();.. I would like to avoid that.. is it possible?.. Im pretty sure I have done something like this using Castle.DynamicProxy once before.. but my current application just so happened to have Unity installed so it seamed like a good idea to re-use Unity as far as possible.
Another reason for not using the container.Resolve() is that this instance of mine might as well be created inside an MVC action, which doesnt have a logical reference to the container.. and I dont think that injecting the MyTestClass as a paramter to the constructor would be a very good idea..
Br, Inx
From the docs:
The syntax is ugly though.