My domain model objects mostly have private fields where their state is modified by atomic methods that enforce invariants. I'd really rather not use private properties and keep them as fields.
Is there a way to configure RavenDb to include private fields in its serialization?
I think what I want is something similar to what's described in this post for JSON.Net library which I think RavenDb uses under the hood, but I cannot see a way to implement what's described.
I can see there is this:
docStore.Conventions.CustomizeJsonSerializer
But I still can't figure out where to instruct it to include fields?