![]() |
Sphyrnidae Common Library
2.0.1
Shared Utilities/Library
|
The Serialization class is a collection of extension methods that allow you to de/serialize JSON or XML. The JSON methods take an optional parameter of JsonSerializerSettings - default is to specify DefaultValueHandling.IgnoreAndPopulate. You can specify any of the pre-configured SerializationSettings, or you can specify your own custom JsonSerializerSettings.
var obj = new Foo();
var serialized = obj.SerializeJson();
obj = serialized.DeserializeJson<Foo>();
serialized = obj.SerializeXml();
obj = serialized.DeserializeXml<Foo>();