We\'re using JSON.net and want to use a consistent way to send and receive data (documents).
We want a base class that all documents will be derived from. The base c
You can do this with an Enum, I don't know if DocumentType is a enum but it should.
enum DocumentType {
XML,
JSON,
PDF,
DOC
}
When deserializing the request it will give you an error if the client sends you an invalid enum. The "InvalidEnumArgumentException" which you can catch and tell the client that it's sending an non valid DocumentType.