I have the following classes...
public class Order
{
private Guid id;
public Guid ID
{
get { return id; }
set { id = value; }
}
private List<Items> orderItems;
public List<Items> OrderItems
{
get { return orderItems; }
set { orderItems= value; }
}
}
public class Item
{
private Guid id;
public Guid ID
{
get { return id; }
set { id = value; }
}
private string itemName;
public string ItemName
{
get { return itemName; }
set { itemName = value; }
}
}
Then within my application I try the following....
ACME.Order newOrder = new ACME.Order();
newOrder.ID = xxx
newOrder.OrderItems = new List<OrderItem> {
new ACME.OrderItem {
ID = xxx
ItemName = xxx
}
}
However I get the error "Cannot implicitly convert type 'System.Collections.Generic.List<ACME.Item>'
to ACME.Item[]
. The strange thing as well is that all I don't have an "Add" option on any of my list objects.