Click here to Skip to main content
15,886,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
using System.Data.Entity;

namespace Shop.Models
{
public class ProductionContext : DbContext
{
public DbSet<spareparts> parts {get;set;}
....
}
}

//Getting following msg. form the underlined:
//The type or namespace 'DbContext' could not be found (are you missing a using //directive or an assembly reference?)
Posted

1 solution

The DbContext class actually lives in the EntityFramework.dll so you need to add reference to that. You can easily do this by adding the Entity Framework NuGet package to your project.

https://msdn.microsoft.com/en-us/library/system.data.entity.dbcontext%28v=vs.113%29.aspx[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900