Creating object of another object

  • Thread starter Maziar Aflatoun
  • Start date
M

Maziar Aflatoun

Hi everyone,

I like to do the following,

1. Create an object that holds the customer general information
2. Add multiple orders for the customer
3. Serialize and dump to XML

I have already taken care of part 1. and know part 3. However, what the best
of adding multiple orders for 1 customer. Ex.

Can someone please show me an example of adding multiple orders (Order) to
the Customer object? Can be 1 or more Orders.


public class Customer
{
public string FirstName;
public string LastName;

public Customer()
{
}
}

public class Order
{
public string Name;
public string Qty;

public Order()
{
}
}

Thank you
Maz.
 
K

Kevin Spencer

Hi Maziar,

Use an Array of the Order class in the Customer Class. Arrays are implictly
serializable.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.
 

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

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top