I have a WCF service (happy joy) all my messages inherit from the abstract class MessageBase and implements the below interface.
public interface IMessageBase<T> where T : class
{
String Serialize(T data);
T Deserialize(string text);
}
Each time one of my operation contracts is hit with a message like this I want to log this message. As soon as a method is requested and one of the inbound parameters is assignable to IMessageBase then I want to execute logging without fudging with the actual method. How would I achieve this? I suppose I would need to do this in my IDispatchMessageInspector but how?