I am working on a messaging subsystem capable of transmiting generic XML messages. A message could possibly be interpreted and deserialized to a concrete type and I try to find a readable and useful way of denoting a type name.
For a simple class like this one
what would be the output of
Well, the output is
Which one of these would you pick as a public denotation of the type name? My obvious choice was the second one, what was yours?
I was however quite surprised to see that this one
doesn’t look as clean as I expected:
A small disaster I would say. The type itself is denoted nicely but the inner generic type is either not denoted at all (type.Name) or denoted with full information.
And, surprisingly, the simplest answer is to use .ToString().