The type or namespace name 'Employee' could not be found in Entity Framework

58 Views Asked by At

I am working with Entity Framework database first approach. I have selected the table which I created in database to my model while creation. But unfortunately it is throwing an exception like as follows in Model1.context.cs file:

The type or namespace name 'Employee' could not be found (are you missing a using directive or an assembly reference?) ConsoleApp6 C:\Users\lenovo\source\repos\ConsoleApp6\ConsoleApp6\Models\Model1.Context.cs

I am having only one Employee table in my database. And that was created in edmx UML diagram also but not able to see the class which it should get generated. What could be the problem?

Error throws at :

public virtual DbSet<Employee> Employees { get; set; }

As like Employee class not exist.

0

There are 0 best solutions below