JsonNet.ContractResolvers 1.1.0

Custom contract resolvers for Newtonsoft JSON.Net, supporting e.g. private setters and private constructors.

Install-Package JsonNet.ContractResolvers -Version 1.1.0
dotnet add package JsonNet.ContractResolvers --version 1.1.0
<PackageReference Include="JsonNet.ContractResolvers" Version="1.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add JsonNet.ContractResolvers --version 1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Install the package and use one of the shipped contract resolvers, e.g. PrivateSetterContractResolver:

var settings = new JsonSerializerSettings
{
    ContractResolver = new PrivateSetterContractResolver()
};

var model = JsonConvert.DeserializeObject<Model>(json, settings);

The shipped resolvers are:

  • PrivateSetterContractResolver - extends DefaultContractResolver with support for private setters.
  • PrivateSetterAndCtorContractResolver- extends DefaultContractResolver with support for private setters and private constructors.
  • PrivateSetterCamelCasePropertyNamesContractResolver - extends CamelCasePropertyNamesContractResolver with support for private setters.
  • PrivateSetterAndCtorCamelCasePropertyNamesContractResolver- extends CamelCasePropertyNamesContractResolver with support for private setters and private constructors.

Install the package and use one of the shipped contract resolvers, e.g. PrivateSetterContractResolver:

var settings = new JsonSerializerSettings
{
    ContractResolver = new PrivateSetterContractResolver()
};

var model = JsonConvert.DeserializeObject<Model>(json, settings);

The shipped resolvers are:

  • PrivateSetterContractResolver - extends DefaultContractResolver with support for private setters.
  • PrivateSetterAndCtorContractResolver- extends DefaultContractResolver with support for private setters and private constructors.
  • PrivateSetterCamelCasePropertyNamesContractResolver - extends CamelCasePropertyNamesContractResolver with support for private setters.
  • PrivateSetterAndCtorCamelCasePropertyNamesContractResolver- extends CamelCasePropertyNamesContractResolver with support for private setters and private constructors.

NuGet packages (4)

Showing the top 4 NuGet packages that depend on JsonNet.ContractResolvers:

Package Downloads
NTestHelper
Mostly copied and pasted C# classes that ease your live of writing unit tests.
Orikami-TA.GreatDomain.Infrastructure.Eventstore
Bibliothèque de classes utilitaires pour la mise à disposition d'une infrastructure reposant sur la technologie Eventstore (https://eventstore.org) pour la librairie GreatDomain
TenorClient
Client for interacting with the Tenor API with full async support. Built on .NET Standard 2.0.
RentDynamics.RdClient
C# client library to access RentDynamics APIs

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.1.0 119,950 1/6/2019