Fixed serialisation issue in samples using Newtonsoft Json.NET
It seems that during the .NET upgrade, I broke Newtonsoft Json.NET serialisation. I removed the usage of JsonConstructor
and NuGet that extended Json.NET with private constructors. Unfortunately, the test suite was not strong enough. That was strengthened up in this release.
I added ContractResolver
which enables private non-default constructors.
Details
- Added
JsonObjectContractProvider
that resolves Json object constructor, to support non-default, private constructor by default. - Moved JSONserialisationn to dedicated project to be able to not have a dependency on Core in the Test project,
- Added default
JsonSerializerSettings
and used in Newtonsoft related projects, - Added
NonDefaultConstructorContractResolver
andNonDefaultConstructorMartenJsonNetContractResolver
that useJsonObjectContractProvider
internally - Added missing tests for Cart Confirmation and Adding Product in Marten ECommerce Sample.
- Updated Requests classes to records in Marten ECommerce Sample.
Note: JsonObjectContractProvider
will be added to Marten in the follow-up PR.