JsonNet.ContractResolvers 1.1.0

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

There is a newer version of this package available.
See the version list below for details.
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.
#r "nuget: JsonNet.ContractResolvers, 1.1.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install JsonNet.ContractResolvers as a Cake Addin
#addin nuget:?package=JsonNet.ContractResolvers&version=1.1.0

// Install JsonNet.ContractResolvers as a Cake Tool
#tool nuget:?package=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 (7)

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

Package Downloads
RidgeDotNet
Tool that alows strongly typed integration tests and subcutaneous razor tests.
NTestHelper
Mostly copied and pasted C# classes that ease your live of writing unit tests.
EventSourced.Persistence.InMemory
Package Description
RentDynamics.RdClient
C# client library to access RentDynamics APIs
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

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
2.0.0 17,215 3/28/2021
1.1.0 268,470 1/6/2019