Serialization
https://github.com/Elders/Cronus/issues/269
ISerializer interface is simple. You can plug your own implementation in but should not change it once you are in production.
The samples in this manual work with JSON and Proteus-protobuf serializers. very ICommand, IEvent, ValueObject or anything which is persisted is marked with a DataContractAttribute and the properties are marked with a DataMemberAttribute. Here is a quick sample how this works (just ignore the WCF or replace it with Cronus while reading). We use Guid for the name of the DataContract because it is unique.
Best Practices
You can/should/must...
you must add private parameterless constructor
you must initialize all collections in the constructor(s)
you can rename any class whenever you like even when you are already in production
you can rename any property whenever you like even when you are already in production
you can add new properties
You should not...
you must not delete a class when already deployed to production
you must not remove/change the
Nameof theDataContractAttributewhen already deployed to productionyou must not remove/change the
Orderof theDataMemberAttributewhen deployed to production. You can change the visibility modifier frompublictoprivate
Last updated
Was this helpful?