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 ."
2 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.

Sthitaprajnya Debasis NayakPosted Feb 21, 2016, 12:26 PM
Rajeev PunhaniPosted Feb 21, 2016, 6:16 AM
If the above solution is helpful then,accept the answer.