質問

Using JOliver EventStore 3.0 with the Json Serialization addon, I'm invoking it during configuration as such:

var eventStore = Wireup.Init()
    .UsingRavenPersistence("RavenDB")
    .InitializeStorageEngine()
    .UsingJsonSerialization()
    .Build();

It's working fine, but I can't figure out how to customize the serialization. It's using Json.Net under the hood, so I should be able to tweak the serialization, for example to add the ISODateTimeConverter.

Does EventStore expose the serializer in any way, such that I can adjust it?

Raven does this with documentStore.Conventions.CustomizeJsonSerializer. Does EventStore have something similar already?

役に立ちましたか?

解決

As far as I can tell there's no configuration options to allow you to do this. The EventStore also internalises its dependencies, so you won't be able to 'get at' the Json.NET classes. You can create your own EventStore wireup extensions though and, by taking a dependency on Json.NET yourself, configure your own Json serializer.

This is actually how it's done in NES for the custom serialisers, you can find an example here if you're interested: https://github.com/elliotritchie/NES/blob/master/src/NES/EventStore/NESWireup.cs

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top