title: C# multi level object and list access
body: <p>I have no idea what should this question be titled nor keyword to search.</p>
  
  <p><strong>Scenario</strong>:
  I have a model as below</p>
  
  <pre><code>public class Message { public List&lt;Page&gt; Pages { get; set; }
  public class Page { public List&lt;Line&gt; Lines { get; set; }
  public class Line { public string Text {get; set; }
  </code></pre>
  
  <p>When I wanted to insert a <code>Line</code> with <code>Text = "Test"</code> at <code>Page</code> 1, I would need to do the following.</p>
  
  <pre><code>var Message = new Message();
  var line = new Line { Text = "Test" };
  var page = new Page();
  page.Lines.Add(line);
  Message.Pages.Add(page);
  </code></pre>
  
  <p><strong>Question</strong>: are there any easier way to achieve this? Eg.</p>
  
  <pre><code>Message.Pages[0].Lines[0].Text = "Test";
  </code></pre>
  
  <p>Thanks.</p>
  
  <p><strong>Edit</strong>: Assumed all properties are properly instantiated in constructors.</p>