Friday 15 March 2013

c# - Nested List Question -


I have a question about nested lists

I have a class like the following. .

  Public Class Orders {Private Guide ID; [Database] Public Gid ID {Get {Return ID; } Set {id = value; }} Private listing & lt; Items & gt; order items; [Database] Public list & gt; Items & gt; Order item (get {return order;} set {orderItems = value;}}} public class item {personal string itemName; [datamember] public string itemName {get {return itemName;} set {itemName = value;}}} < / Code> 

It is okay till I write no reference within my code in the list

  if myItemName = this.order.orderItems [0]. ItemName  

The problem occurs when I add "[0] .itemName" Can I help me with something missing?

< P>

Try compared to public property: (note the change of case)

name = myItemName = this.order.OrderItems [0] .imername

In addition, syntax looks awkward, what language are you using? Do you mean:

  if (this.order.OrderItems.Count & gt; 0 & amp; amp; amp; amp; myItemName == this.order.OrderItems [0] .ememame) ...  

No comments:

Post a Comment