Pergunta

We are using NEventStore (the artist formerly known as Jonathan Oliver's EventStore) to store our CQRS events. I would like to know if it is necessary to create a new version of an Event if we wish to add a new property to the Event.

I understand that we should not rename an existing property as that will create a problem when reading the events from EventStore. But, if we are only adding new properties will it create any issues?

Foi útil?

Solução

Depends on how you are serializing the messages. In other words, the best way to phrase this (/ search for an existing answer) is to identify how you are serializing the messages and then find out how that mechanism deals with the issue.

Assuming it's JSON with JSON.NET and simple POCOs, then the answer is that adding a property is handled pretty cleanly - in the absence of any customizations (which is very doable), new fields come in withe default(T), i.e. null or 0 for each relevant value.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top