If I have both IParameterInspector
and IErrorHandler
attached to a service can I be sure IErrorHandler.HandleError()
will be called on the same thread where IParameterInspector.BeforeCall()
is called?
I need this because in case of a fault thrown IParameterInspector.AfterCall()
is never called and there is no way (as far as I know) I can get correlation state object created in BeforeCall()
. So I hope to overcome this by having a ThreadStatic
field in my implementation of the interfaces :(
You may want to utilize Instance Context Extensions.
The instance context extension can be added in
BeforeCall
method. The instance context extension can then be retrieved inAfterCall
method and used. Any operation specific data can be put in this extension object instead of introducing thread affinity.