I use NancyFx, I've tried to find the answer prior to question.
I have a single return type per module, but in different URL routes I need to serialize it differently, just specific properties. If I wire serialization in Nancy pipeline, it touches all routes.
Is it possible to customize serialization per route or module without copy pasting the same type in different namespaces?
I've come up with 2 solutions:
JsonConvert
attribute on corresponding overriden props;string
.