C# Serializable Keyword

What is the use of serializable keyword in C#?

Questions by selvimathi   answers by selvimathi

Showing Answers 1 - 15 of 15 Answers

GeekBoy001

  • Dec 25th, 2008
 

Marking a class with the key word [Serializable] at the top ensures that the object can be serialized in an XML format primarily for data exchange between disparate systems.  Also, this is required if this object is going to be inherited by other objects which needs to be serialized downstream.

rags_73

  • Mar 26th, 2009
 

Preserving the state of an object is called as serialization and serialization is needed whenever you want communicate across process as well as physical boundaries.

Serializable is a concept of converting your user define type i.e. class into bytes. Serializing object into bytes help for ease in transporting data within network or machines. .Net also provides support to desializing

We can do Serializing in following ways:
i. XmlSerializer.
ii. Soap Formatter and Binary formatter.


azita2005

  • Apr 6th, 2010
 

Serialization is the process of taking an object and convert it to a format that can be transmitted over the network or save in database or store in the file.

Objects may be serialized in three formats: Binary, Soap and Xml.

Remoting and Web Services depend heavilly on Serialization and De-serialization.

kirangiet

  • Jun 8th, 2010
 

We usually serialize the object, which we are transferring across processes.

Example: When we are using Out Proc session Management we should add the serializable attribute at the top of the class.

e.g.

[Serializable]
public Class Employee
{
public string Name;
public int Age;
}

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions