user8034434
user8034434

Reputation:

Exclude an Entire Type ( Class ) from Serializing

I want to know if there is a way to use the [XmlIgnore] tag on an entire type(A class )

So the deal is I have three particular classes A Base Class which is being Extended by a class A and a Class B.

I want everything in Class A to be Serialized but Nothing in Class B should be Serialized.

I tried adding the [XmlIgnore] tag to all properties of class B but that was no good because , 1. Some properties are overridden from the base class 2. Some Properties are inherited from the Base class.

Anyway I can do this ?? Isn't there like a way to ignore an entire type when serializing to xml

Upvotes: 1

Views: 41

Answers (1)

Tom
Tom

Reputation: 163

I think you may have to add XMLIgnore tag to each property in the class.

Upvotes: 1

Related Questions