title: An exception of type 'System.Data.Entity.ModelConfiguration.ModelValidationException' occurred in EntityFramework.dll
body: <p>Error-An exception of type 'System.Data.Entity.ModelConfiguration.ModelValidationException' occurred in EntityFramework.dll but was not handled in user code
  Additional information: One or more validation errors were detected during model generation:
  MVCApplication.Models.Employee: : EntityType 'Employee' has no key defined. Define the key for this EntityType.
  Employees: EntityType: EntitySet 'Employees' is based on type 'Employee' that has no keys defined.</p>
  
  <p>controller code:</p>
  
  <pre><code>namespace MVCApplication.Controllers
  {
      public class EmployeeController : Controller
      {
          // GET: Employee
          public ActionResult Detail(int id)
          {
              EmployeeContext employeecontext = new EmployeeContext();
              Employee emp = employeecontext.Employees.Single(x =&gt; x.Emp_Id ==id);//here its throwing an exception
              return View("employee",emp);
          }
      }
  </code></pre>
  
  <p>this is my model employee class:</p>
  
  <pre><code>namespace MVCApplication.Models
  {
      [Table("Employee")]
      public class Employee
      {
          public int Emp_Id { get; set; }
          public string Emp_Name { get; set; }
          public string Designation { get; set; }
          public string City { get; set; }
          public string State { get; set; }
          public string Country { get; set; }
      }
  }
  </code></pre>
  
  <p>this is my employee context class:</p>
  
  <pre><code>namespace MVCApplication.Models
  {
      public class EmployeeContext : DbContext
      {
          public DbSet&lt;Employee&gt; Employees { get; set; }
      }
  }
  </code></pre>