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