Skip to content

Extension method for Newtonsoft to allow JObjects to behave like a specific interface (Duck Typing)

License

Notifications You must be signed in to change notification settings

sudsy/JsonDuckTyper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JsonDuckTyper

This is a simple extension method for Newtonsoft to allow JObjects to behave like a specific interface (Duck Typing)

A little bit more info here: https://stackoverflow.com/questions/5780888/casting-interfaces-for-deserialization-in-json-net/45646664#45646664

and here: http://www.lighthouselogic.com/deserialize-json-to-interface-without-concrete-class/

It's definitely a work in progress but you can see what's supported by looking at the tests.

If you find something that is not supported, create a test for it and the code and send me a pull request.

It's been published on nuget for convenience.

About

Extension method for Newtonsoft to allow JObjects to behave like a specific interface (Duck Typing)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages