title: Monotouch: TableView parent data class, sections, and items setup
body: <p>i'm a newbie to both C# and Monotouch/iOS programming.</p>
  
  <p>I am creating a table view's data source and was setting up the object data for it. Here is what i need to implement:
  Restaurant Menu --> Menu Sections --> Section Items. One additional requirement that the restaurant has multiple menus. I designed the classes as follows:</p>
  
  <pre><code>public class Menu
  {
      public int Id { get; set; }
      public string Name { get; set; }
      public List&lt;MenuSection&gt; Sections { get; set; }
      public List&lt;SectionItem&gt; Items { get; set; }
  }
  
  public class MenuSection
  {
      public int Id { get; set; }
      public string Name { get; set; }
  }
  
  public class SectionItem
  {
      public int Id { get; set; }
      public string Name { get; set; }
      public string Description { get; set; }
      public decimal Price { get; set; }
  } 
  </code></pre>
  
  <p>Do i declare the Items (SectionItems) in Menu class or in MenuSection class? What is the correct implementation of such a hierarchy in C# ? Thanks!</p>
  
  <p>UPDATE</p>
  
  <p>@Jason, With the solution you proposed i am running into an implementation issue. How do i relate Items to a Menu? I have to go through the hierarchy Item->Section->Menu. Would i be able to add Items to a specific menu given your proposed structure?</p>
  
  <p>Ex:</p>
  
  <pre><code>List&lt;Menu&gt; menuList = new List&lt;Menu&gt; ();
  Menu menu;
  
  menu = new Menu (){ Id = 1, Name = "Lunch Menu" };
  menu.Sections.Add(new MenuSection(){ Id = 1, Name = "Specials"});
  menuList.Add(menu);
  
  menu = new Menu (){ Id = 2, Name = "Dinner Menu" };
  menu.Sections.Add(new MenuSection(){ Id = 1, Name = "Salads"});
  menuList.Add(menu);
  </code></pre>
  
  <p>How do i add items without knowing which menu and which sections i am adding it to? Can you please provide an example of adding an item to one of the menus above? One solution that comes to mind is to denormalize Menu and Section by adding Menu.Id and Menu.Name to Section then i only have to deal with a single hierarchy; but, that would be avoiding the issue. There must be a better way. Thanks for helping.</p>