EF6 data access library
As mentioned in the preceding section, EF6 works only on full .NET Framework; so, we can't directly use them in an ASP.NET Core application. For this, we will need a class library and we will perform reverse engineering on the existing database, AdventureWorks2014 is our example.
Reverse engineering is a process in the Entity Framework (ORM) to generate the classes/models (they correspond to tables) and build a database context to work with the database.
Create a blank Visual Studio solution, AdvWorksAPI, and add class library AdvWorksAPI.DataAccess to it. This will act as data access layer and will be referenced in ASP.NET Core app.
To generate classes/models using reverse engineering, right-click on the project name ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access