Serialization is the process by which an object's state is transformed into a set of bytes (depending on the serialization type used, it could be XML, binary, JSON), which can then be saved in a stream (think MemoryStream or FileStream) or transmitted via WCF or Web API. Making a custom type serializable means that you can apply serialization to custom types by adding the System.SerializableAttribute. Examples of custom types are as follows:
- Classes and generic classes
- Structs
- Enums
A real-world example of serialization could be to create a recovery mechanism for a specific object. Think of a workflow scenario. At some point in time, the state of the workflow needs to be persisted. You can serialize the state of that object and store this in a database. When the workflow needs to continue at a future point in time, you can read the object from the database and deserialize...