title: EntityType has no key defined error
body: <p><strong>Controller:</strong></p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.Web.Mvc;
  using MvcApplication1.Models;
  using System.ComponentModel.DataAnnotations.Schema;
  
  namespace MvcApplication1.Controllers
  {
      public class studentsController : Controller
      {
          //
          // GET: /students/
  
          public ActionResult details()
          {
              int id = 16;
              studentContext std = new studentContext();
             student first = std.details.Single(m =&gt; m.RollNo == id);
              return View(first);
          }
  
      }
  }
  </code></pre>
  
  <p><strong>DbContext Model:</strong></p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.Data.Entity;
  
  namespace MvcApplication1.Models
  {
      public class studentContext : DbContext
      {
          public DbSet&lt;student&gt; details { get; set; }
      }
  }
  </code></pre>
  
  <p><strong>Model:</strong></p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.ComponentModel.DataAnnotations.Schema;
  
  namespace MvcApplication1.Models
  {
      [Table("studentdetails")]
      public class student
      {
          public int RollNo;
          public string Name;
          public string Stream;
          public string Div;
      }
  }
  </code></pre>
  
  <p><strong>Database table:</strong></p>
  
  <pre><code>CREATE TABLE [dbo].[studentdetails](
      [RollNo] [int] NULL,
      [Name] [nvarchar](50) NULL,
      [Stream] [nvarchar](50) NULL,
      [Div] [nvarchar](50) NULL
  )  
  </code></pre>
  
  <p><strong>In global.asax.cs</strong></p>
  
  <pre><code>Database.SetInitializer&lt;MvcApplication1.Models.studentContext&gt;(null);
  </code></pre>
  
  <p>The above code lists all the classes I am working on. Upon running my application am receiving the error:</p>
  
  <blockquote>
    <p>"One or more validation errors were detected during model generation" along with "Entity type has no key defined".</p>
  </blockquote>