title: View and ICollection Question
body: <p>I am coverting my app from webforms to mvc, at the moment i am at a design issue (well i just dont know how to do it in mvc).</p>
  
  <p>Basically my model would be something like this:</p>
  
  <pre><code>public class DamagedItem 
  {
    public Int32 LoanId {get;set;}
    public String IdentityCode {get;set;}
    public virtual ICollection&lt;DamagedItems&gt; DamagedItems {get;set;}
  }
  </code></pre>
  
  <p>In my controller i would like to do:</p>
  
  <pre><code>public ActionResult Add(DamagedItem damagedItem)
  {
    //Do update logic here
  
  }
  </code></pre>
  
  <p>Then in my view i can add to the ICollection as needed.
  But, i can't do this because if i try and access the ICollection from my controller it is null.</p>
  
  <p>Here is an image of when i want to do:
  <img src="https://i.stack.imgur.com/CoDMR.png" alt="enter image description here"></p>
  
  <p>I just dont know how to lay it out in my view, how to i add such items to my ICollection, update the view then when i need to save i have access to what i have added from my controller?</p>
  
  <p>Thanks,
  Nick</p>
  
  <p>Edit: </p>
  
  <hr>
  
  <p>I was thinking of using a partial in the view and doing all the logic for the bottom half using ajax and storing it in a session variable, but i would prefer NOT to make it reliant on ajax.</p>