Hi Friends !!!
please help me out.
Model class
[Table("tbl_Employee")]
public class Employee
{
[key]
public int EmpID { get; set; }
public string Name { get; set; }
public string Gender { get; set; }
public string City { get; set; }
}
controller class Action Methode
public ViewResult HyperLink()
{
EmployeeDBContext objEmployeeDbContext = new EmployeeDBContext();
List
return View(Employees);
}
While I am trying to add a Strongly typed view to this Action method I am getting an error like below" MVCDemo.Models.Employee:: Entity type "Employee" has no key defiened. Define the key for this entity type ."

Rajeev PunhaniRank #551 · 4.4K reputationPosted Feb 21, 2016, 1:16 AM EST
If the above solution is helpful then,accept the answer.
Sthitaprajnya Debasis NayakRank #2,017 · 717 reputationPosted Feb 21, 2016, 7:26 AM EST
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts