Skip to content

Commit

Permalink
improve documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
manuc66 committed Apr 17, 2018
1 parent 8b225de commit 95acc66
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,13 @@ public class Cat : IAnimal {
}
```

The second parameter of the `JsonConverter` attribute is the JSON property name that will be use to retreive the type information from JSON.

```csharp
var animal = JsonConvert.DeserializeObject<IAnimal>("{\"Kind\":\"Dog\",\"Breed\":\"Jack Russell Terrier\"}");
Assert.AreEqual("Jack Russell Terrier", (Animal as Dog)?.Breed);
```

N.B.: Also works with fully qualified type name

## DeserializeObject with custom type mapping
Expand Down

0 comments on commit 95acc66

Please sign in to comment.