Generic Repository EF6 (edit)

EF Core:
Design Patterns: Generic Repository, Unit of Work,

How to: Use EdmGen.exe to Generate the Model and Mapping Files

EF and ObjectContext
"%windir%\Microsoft.NET\Framework\v4.0.30319\edmgen.exe" /mode:fullgeneration /c:"Data Source=;Initial Catalog=DBWC;User ID=sa;Password=92pU7nxa" /project:MVCTutorial.Repository /entitycontainer:MVCTutorialEntitiesContainer /namespace:MVCTutorial.Repository /language:CSharp

+ ObjectContext can be used by Entity Framework 4.0 and below.
+ The ObjectContext class is not thread-safe.

EF and DbContext + DbSet
Create Entity Data Model:
+ .NET Framework 4.5
+ Add > New Item of ADO.NET Entity Data Model
+ Name: School, Project: MVCTutorial.Repository , EntityContainer: MVCTutorialEntitiesContainer
+ Entity Data Model (School.edmx file)
+ Etc: School.edmx and see two important files, and

+ DBContext can be used by Entity Framework 4.1 and above.
+ Any public static (C#) or Shared (Visual Basic) members of DbContext are thread-safe. Any instance members are not guaranteed to be thread safe.

EF5 & DbContext

Read more:

Cách dùng:
using (var ctx = new SchoolDBEntities())
//Can perform CRUD operation using ctx here..

using (var ctx = new SchoolDBEntities())
var objectContext = (ctx as System.Data.Entity.Infrastructure.IObjectContextAdapter).ObjectContext; //use objectContext here..

EF 6
1. Go to Tools -> Get Tools and features
2. Select Individual components tab and check Entity Framework 6 tools under SDK's, libraries, and framework section

EF 6 - Entity Framework 6 Tools - Missing ADO.NET Entity Data Model template in VS2017
it looks like the Entity Framework 6 Tools component wasn't selected when you installed. By default, this will be installed if you select the .NET desktop development or ASP.NET and web development workloads on the main install screen (though you can also unselect it under these workloads). If you don't use either of those workloads, you can always (as you did) install it individually from the Individual components tab.

You’re All Doing Entity Framework Wrong

EF Core