title: C# Instantiate and add Values to Nested List in Model
body: <p>I have a unit test class where I am doing some testing on a factory. In this unit test I mock some data. In the mocked data I have the NumberModel (parent model) inside the NumberModel I have a nested list of models called ReferenceModel. I have instantiates many lists while adding values to them all on the same line, but when I tried to do this with my nested list of models I found that I could not.</p>
  
  <p>Here is a snippet from the unit test class where I am mocking my data.</p>
  
  <pre><code>_numberModel = new NumberModel()
  {
     value1 = 1,
     value2 = x,
     referenceList = new List&lt;ReferenceModel&gt; { ID = 55, NumberType = Mean } &lt; -- These show undefined
  };
  </code></pre>
  
  <p>What am I doing wrong here? Do I need to drill down to the nested list in the parent model, so that the nested list of models are defined?</p>