ssteenkiste / nettiers

Automatically exported from code.google.com/p/nettiers
1 stars 0 forks source link

Overriding property serialization #206

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Request for Enhancement.
Pros. controlling the size of the serialized XML in runtime.

What steps will reproduce the problem?
1. Put [XmlIgnore] on a overridden collection property in the parent entity
class
2. Serialize the instance of that class (using WebService)
3. The collection property is serialized even dough it's marked with
[XmlIgnore]

What is the expected output? What do you see instead?
Collection property is serialized even dough it's marked with [XmlIgnore].
This is a .NET problem (or just the way it works)

What version of .netTiers and CodeSmith are you using?
netTiers  2.3

Please provide any additional information below.
Solution is to expand the EntityInstanceBase.generated.cst with 
...
[XmlIgnoreAttribute]
public bool [propertyName]Specified = true;
...
line 1519, 1538 and 1555 

in the parent class if this bool property is marked as false the serializer
will NOT serialize that property.

The similar fix is discussed here 
http://stackoverflow.com/questions/592671/overriding-a-property-with-an-attribut
e

Modified EntityInstanceBase.generated.cst is attached

Original issue reported on code.google.com by fed...@gmail.com on 29 Apr 2009 at 6:46

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by bniemyjski on 25 May 2009 at 3:30

GoogleCodeExporter commented 9 years ago

Original comment by bniemyjski on 25 May 2009 at 4:01