Can I customise the serialization process

Answer Posted / kirti

Yes. XmlSerializer supports a range of attributes that can be used to configure serialization for a particular class. For example, a field or property can be marked with the [XmlIgnore] attribute to exclude it from serialization. Another example is the [XmlElement]

attribute, which can be used to specify the XML element name to be used for a particular property or field.

Serialization via SoapFormatter/BinaryFormatter can also be controlled to some extent by attributes. For example, the [NonSerialized] attribute is the equivalent of XmlSerializer's [XmlIgnore] attribute. Ultimate control of the serialization process can be acheived by implementing the the ISerializable interface on the class whose instances are to be serialized.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is filters in web api?

515


Explain ASP.NET MVC Identity and Security?

576


Where is tempdata stored?

552


What is ado.net data provider? : Entity framework

573


what is deferred loading(lazy loading)?

580






What is the difference between old ADO.NET and Entity framework coding techniques?

565


What is routeconfig.cs in mvc 4?

651


Explain the .net framework.

542


Which are the important namespaces used in ASP.Net MVC?

601


When will the .net framework 3.0 be released?

554


what is split entity?

605


Mention two instances where routing is not implemented or required?

751


What is the difference between entity framework and mvc?

523


Explain what is the difference between view and partial view?

584


What is rxjava used for?

666