You could do this by creating your own deserializers and then registering them with Gremlin.Net. You then either have to add your own custom GraphSON types for which you control the deserialization or you could add your own
MapSerializer for the
GraphSON type Map which then doesn't create a map but objects of your types. Note though that the serialization and deserialization in Gremlin.Net are not type aware so your serializer won't know the type, e.g.,
Person in your example. You probably have to include it therefore in the map that comes from the server for example as the label for the serializer.
If you decide to even add your own custom GraphSON types then you of course also have to add serializers for them on the server side and in all other clients.
The alternative to this would keep the serialization / deserialization in Gremlin.Net as is and then just work with dictionaries to create instances of your own types. Reflection or a code generator could be helpful for this if you have a lot of types.
I think this is in general an area where Gremlin.Net could be improved but I'm not sure yet how exactly. The problem is that we have the GraphSON / GraphBinary types (as described in the
IO reference) that we get from the server that drive the deserialization right now. We would need to add the option for users to specify the expected return type and then use that in conjunction the type information returned from the server for the deserialization.
If you want to work on that, then I would of course be glad to help if you need any.