tags:

views:

40

answers:

1

Hi,

I have two questions

  1. 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>

I need it to format as

<Property Type="TestType">TestValue</Property>

but I am not sure how? I have set Value to represent an Element, which does explain why it gets it's own tags but I don't want them.

  1. 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" />

otherwise

<Parameter Name="Foo" />

Thanks Phill

A: 

I'm not sure if this will work or not, but in the DSL explorer, find the classes Serializer and you can mark it as custom. If you transform and compile you'll get a bunch of errors that indicate you need to provide your own custom serializer. I believe that you can put these customizations and other in there, though it may be more work than you are looking for.

MrSlippers