I need to connect to the event in a somewhat unusual way in WCF.
I pass the model from client to server and I need access to this model:
- After creating the model, but
- Before the input was actually deserialized for this model
The reason is that I actually have deserialization events that are conditional, and ideally I want this condition to be a property of the object; this way I will have a template:
create object-> set property-> deserialize the rest of the object based on this property
Is there an event in WCF that I can connect to? I have an attribute configured to intercept the settings of "IOperationBehavior" and "IParameterInspector", but they do not (as far as I can tell) actions that intercept the creation and deserialization events.
Alternatively, I will be fine with changing the data coming from the wire, and explicitly adding this property to the incoming data, if I can guarantee that this will be the first property deserialized.
Any ideas?
[Edit] Minor note. I am using JSON as a data transport here, and not something that should really affect the final decision.
source share