mercredi 28 janvier 2015

How to pass a value from one intercepted call the the next

I have one question related to this here, however the lack of response suggests that maybe I was looking in the wrong place.


So.


I have some classes, Foo1, Foo2, Foo3. Foo1 calls Foo2, calls Foo3.


They are all registered in a unity container, with an InterfaceInterceptor.



public IMethodReturn Invoke(IMethodInvocation input, GetNextInterceptionBehaviorDelegate getNext)
{
// Create a value here, to be passed to the next interception

var methodReturn = getNext()(input, getNext);

return methodReturn;
}


How can I pass an arbitrary value (probably a Guid) to each invocation down the chain?






Aucun commentaire:

Enregistrer un commentaire