-
Notifications
You must be signed in to change notification settings - Fork 9
Basic Usage
Michael Brown edited this page Dec 2, 2018
·
1 revision
using AnySerializer;
var originalObject = new SomeComplexTypeWithDeepStructure();
var bytes = Serializer.Serialize(originalObject);
var restoredObject = Serializer.Deserialize<SomeComplexTypeWithDeepStructure>(bytes);
Extension usage:
using AnySerializer;
var originalObject = new SomeComplexTypeWithDeepStructure();
var bytes = originalObject.Serialize();
var restoredObject = bytes.Deserialize<SomeComplexTypeWithDeepStructure>();
var originalObject = new SomeComplexTypeWithDeepStructure();
var bytes = Serializer.Serialize(originalObject, true); // true to embed type data
var restoredObject = Serializer.Deserialize<SomeComplexTypeWithDeepStructure>(bytes);
var originalObject = new SomeComplexTypeWithDeepStructure();
var bytes = Serializer.Serialize(originalObject);
var isValid = Serializer.Validate(bytes);
Assert.IsTrue(isValid);