title: Having troubles with a List<Color>
body: <p>I have a model with a <code>List&lt;System.Drawing.Color&gt;</code>, as I mentioned, which comes to use in the <code>Seed()</code> like this:</p>
  
  <pre><code>    protected override void Seed(DatabaseContext context)
      {
          var somethings = new List&lt;Something&gt;
          {
              new Something
              {
                  Name="blah blah", Colors= { Color.Black, Color.Red }
              }
          };
      }
  </code></pre>
  
  <p>And as long as I have the <code>Colors</code> over there like that, I always recieve
  <code>Object reference not set to an instance of an object.</code> at line <code>var somethings = new List&lt;Something&gt;</code>.</p>
  
  <p>When I remove the <code>Colors</code>, it goes away and everything works perfectly, what causes this and how can I solve this problem?</p>
  
  <p>Thanks.</p>
  
  <p><em>EDIT:</em></p>
  
  <p><strong><code>Something</code>'s model:</strong></p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.Drawing;
  
  namespace MVCApplication7
  {
      public class Something
      {
          public int SomethingID { get; set; }
          public string Name { get; set; }
          public List&lt;Color&gt; Colors { get; set; }
      }
  }
  </code></pre>
  
  <p><strong>Controller:</strong></p>
  
  <pre><code>    ........
      private DatabaseContext db = new DatabaseContext();
  
      //
      // GET: /Home/
  
      public ViewResult Index()
      {
          return View(db.Somethings.ToList());
      }
  </code></pre>
  
  <p><strong>View:</strong> (I'm sure it's irrelavent because the debugger shows the <code>Colors</code> is empty.</p>
  
  <pre><code>        @foreach (var itemColor in item.Colors)
          {
              Html.Raw(itemColor.ToString());
          }
  </code></pre>
  
  <p><strong>Global.asax</strong></p>
  
  <pre><code>    .........
      protected void Application_Start()
      {
          AreaRegistration.RegisterAllAreas();
  
          RegisterGlobalFilters(GlobalFilters.Filters);
          RegisterRoutes(RouteTable.Routes);
  
          Database.SetInitializer&lt;DatabaseContext&gt;(new DatabaseInitializer());
      }
  </code></pre>