when implementing event sourcing (and aggregates) with mongo, the classes that are "event" needs to be registered with BsonClassMap.RegisterClassMap<T>(); figure it out a way to not need this registration or do the registration abutomatically, as the events should be identificable by IApply<T>
Error Message: error occurred while deserializing the Content property of class Distribt.Shared.EventSourcing.AggregateChangeDto: Unknown discriminator value 'OrderCreated' where OrderCreated is T
Workarounds:
- Add all the events under a
.RegisterClassMap
- store in the
AggregateType the full type(namespace, etc) instead of only the name.
when implementing event sourcing (and aggregates) with mongo, the classes that are "event" needs to be registered with
BsonClassMap.RegisterClassMap<T>();figure it out a way to not need this registration or do the registration abutomatically, as the events should be identificable byIApply<T>Error Message:
error occurred while deserializing the Content property of class Distribt.Shared.EventSourcing.AggregateChangeDto: Unknown discriminator value 'OrderCreated'whereOrderCreatedisTWorkarounds:
.RegisterClassMapAggregateTypethe full type(namespace, etc) instead of only the name.