title: Add items to ICollection
body: <p>I defined an ICollection as</p>
  
  <pre><code> public virtual ICollection&lt;Attempt&gt; Attempts { get; set; }
  </code></pre>
  
  <p>And <code>Attempt</code> is defined as</p>
  
  <pre><code> public class Attempt
   {
       public Guid Id { get; set; }
       public string AttemptsMetaData { get; set; }
       public DateTime Time { get; set; }
       public bool Answered { get; set; }
       public DateTime Disconnected { get; set; }
   }
  </code></pre>
  
  <p>Now I want to pass ICollection to a method.</p>
  
  <pre><code>public void AddTask(ICollection&lt;Attempt&gt; attempts)
  {
      // Do something to the item in attempts.
  } 
  </code></pre>
  
  <p>Now I have to create a sample data to this collection. I am not sure how. The code below maybe wrong.
  What I thought was </p>
  
  <pre><code>        // test data
          Guid id = new Guid();
          string attempt = "test";
          DateTime dt = DateTime.Now.AddDays(-1);
          bool answered = true;
          DateTime disconnected = DateTime.Now;
          ICollection &lt;Attempt&gt; attempts= new List&lt;Attempt&gt;();
          // try to add sample data to the list
  </code></pre>