I have a question about Nested Lists.
I have a class similar to the following...
public class Order
{
private Guid id;
[DataMember]
public Guid ID { get { return id; } set { id = value; }}
private List<Items> orderItems;
[DataMember]
public List<Items> OrderItems { get { return orderItems; } set { orderItems= value; } }
}
public class Items
{
private string itemName;
[DataMember]
public string ItemName { get { return itemName; } set { itemName = value; }}
}
This seems to be ok until i reference the list within in my code saying something similar to
if myItemName = this.order.orderItems[0].itemName
The problem comes when I add the "[0].itemName". Can anyone help me with what I am missing?