Created
January 4, 2017 00:21
-
-
Save bleroy/4875182195cbe87d565f8c9dfea73f36 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var person = new Person { | |
Id = 12345, Name = "Fred", | |
Address = new Address { | |
Line1 = "Flat 1", | |
Line2 = "The Meadows" | |
} | |
}; | |
using (var file = File.Create("person.bin")) { | |
Serializer.Serialize(file, person); | |
} | |
Person newPerson; | |
using (var file = File.OpenRead("person.bin")) { | |
newPerson = Serializer.Deserialize<Person>(file); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment