79533836

Date: 2025-03-25 13:36:36
Score: 3
Natty:
Report link

What you should be doing is serializing event payload and storing it together with event class metadata like class name and namespace.
When reading events from db table you read all aggregate records and restore event class instances using metadata and serialized event payload.

Take a look how it's done in Microsoft patterns & pratices CQRS Journey sample application

https://github.com/microsoftarchive/cqrs-journey/blob/master/source/Infrastructure/Sql/Infrastructure.Sql/EventSourcing/SqlEventSourcedRepository.cs

Reasons:
  • Probably link only (1):
  • Low length (0.5):
  • No code block (0.5):
  • Starts with a question (0.5): What you
  • Low reputation (0.5):
Posted by: Zeljko Vujaklija