title: The entity type 'Microsoft.AspNetCore.Mvc.Rendering.SelectListGroup' requires a primary key to be defined
body: <p>New to .Net Core.</p>
  
  <p>Trying to implement a dropdown list similar to:
  <a href="https://stackoverflow.com/questions/34738481/mvc6-dropdownlist-of-countries">MVC6 Dropdownlist of Countries</a></p>
  
  <p>In my model class I have</p>
  
  <pre><code>public SelectList SiteList { get; set; }
  </code></pre>
  
  <p>In my controller, I have:</p>
  
  <pre><code>var sites = _context.Site.OrderBy(s =&gt; s.Name).Select(x =&gt; new { Id = x.ID, Value = x.Name });
  
      var model = new Issue();
      model.SiteList = new SelectList(sites, "Id", "Value");
  
      return View(model);
  </code></pre>
  
  <p>In my view, I have:</p>
  
  <pre><code>&lt;td class="input-item"&gt;
  &lt;select asp-for="SiteID" asp-items="@Model.SiteList"&gt;&lt;/select&gt;
  &lt;/td&gt;
  </code></pre>
  
  <p>When I try to implement a migration, I get the following error:
  The entity type 'Microsoft.AspNetCore.Mvc.Rendering.SelectListGroup' requires a primary key to be defined.</p>
  
  <p>I tried ignoring in my Migrations namespace:</p>
  
  <pre><code>modelBuilder.Entity&lt;Issue&gt;().Ignore(i =&gt; i.SiteList);
  </code></pre>
  
  <p>But I'm not entirely sure that I've done this in the right spot.</p>