Skip to content

civicsource/json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Archon JSON Utilities

Useful JSON converters and helpers.

How to Use

Install via nuget

install-package Archon.Json
install-package Archon.Json.Enums

The following converters and utilities can be found in the Archon.Json namespace. For a primer on how to use these JSON converters and resolvers, see the Json.Net documentation.

FilteredCamelCasePropertyNamesContractResolver

See here for why this class is necessary. It camel cases property names for types only within the assembly you specify.

LazyJsonConverter

This converter converts any Lazy<T> thing to the actual T. E.g., an object with a Lazy<string> property on it would have that property be serialized as a normal string with this converter.

StringTrimmingConverter

It does what you think it does. It trims strings when serializing and deserializing.

ToStringConverter<T>

It converts the given object to a string and vice versa (using any registered TypeConverters).

DescriptionEnumConverter

It uses the Archon Enum Utils library to convert enums to their description representation and vice versa. Make sure to install the Archon.Json.Enums package.

ExpandedEnumConverter

It uses the Archon Enum Utils library to convert enums to an object containing their original value and their description. Make sure to install the Archon.Json.Enums package.

About

Useful JSON converters and helpers

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages