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.

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.1.0 21,102 1/6/2019