Serialization of complex types

A

alexrixhardson

Hi guys,

I have a class Customer which has customer's properties, and I have a
class Order which has order's properties, one of which is also
property Customer of type Customer.

After serialization of the Orders I end up with a XML that has all the
properties of each order, and also all the properties of the customers
of these orders.

What I would like to do is:
- when serializing Order I want order's base properties and customer's
id as the value of the Customer property (I don't want to serialize
the whole Customer object when serializing Order)
- when serializing Customer I want to serialize all properties of the
Customer object

Can this be done by setting a tag to the order's Customer property
(something similar to XMLIgnore, but just to let know the serializer
to only serialize the ID of the Customer) or some other way?

Thanks & Regards,
Alex
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top