我有两个问题:
- How do I achieve the following, I have a domain class called Property - Property has two properties Type and Value it is currently being serialized as the following:
<Property Type="TestType"><Value>TestValue<Value><Property>
我需要这样作。
<Property Type="TestType">TestValue</Property>
但我并不肯定如何? 我已经设定了代表一个要素的价值,这确实解释了为什么它能够让自己tag,但我不想要他们。
- I have another class - Parameter - it has a property of IsCollection ( a bool ) , I would like the IsCollection attribute to be serialized only when it is set to true, is this possible?
i.e
<Parameter Name="Foo" IsCollection="true" />
其他
<Parameter Name="Foo" />
1 P-4, 1 P-3, 1 P-2