Replies: 2 comments
-
@cool-user Marten needs to know the original type, so without the migration, it won't know about the potential change of type. You could implement and add a custom JSON.NET converter that will be migrating the objects and connecting this converter to JSON serializer. We can try to provide some sample for that. For the more sophisticated built-in mechanism, I don't think that it can happen sooner than in v4 (that we're currently planning) as that might require some breaking changes. |
Beta Was this translation helpful? Give feedback.
-
@oskardudycz @cool-user Honestly, I think we're going to beat this by either some documentation on how to rename your document types or maybe some more formal document migration support. You could do this today with just adding SQL statements. |
Beta Was this translation helpful? Give feedback.
-
I'd like to store derived types in a way that they can be deserialized even after the class name or namespace was renamed.
Currently the derived type's (full) name is stored in the DB. It could potentially change, leading to failure to deserialize. I was thinking about storing type ID along the entity and implementing custom converters which would pick the right derived type based on the stored type ID. But this won't help much, since marten won't understand my thinking and e.g. queries for derived class won't work.
Is this possible to do, currently?
Beta Was this translation helpful? Give feedback.
All reactions