Serialization of complex types

Discussion in 'ASP .Net Web Services' started by alexrixhardson@yahoo.com, Sep 24, 2007.

  1. Guest

    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
     
    , Sep 24, 2007
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    8
    Views:
    2,253
    deadsea
    Jan 2, 2005
  2. Soren Kuula
    Replies:
    2
    Views:
    567
    Henry S. Thompson
    Dec 1, 2005
  3. Replies:
    3
    Views:
    1,037
  4. Dimitri Ognibene
    Replies:
    4
    Views:
    785
    Dimitri Ognibene
    Sep 2, 2006
  5. Ramunas Urbonas
    Replies:
    1
    Views:
    403
    Dino Chiesa [Microsoft]
    Jul 27, 2004
Loading...

Share This Page