Solution consists of 2 projects currently. One is the WebAPI ofcourse, and another is the Data Access layer, which contains the models and DbContext generated from the database.
Adventure Works 2017 database is being used.
In this solution, a separate class library project (.NET Core) is used to store the model and DbContext. To generate or reverse engineer the model, install EntityFrameworkCore using Nuget Package Manager. Once installed, install the sql server database provider using the package manager console.
Install-Package Microsoft.EntityFrameworkCore.SqlServer -Version 2.2.2
Then scaffold the models using the following:
Scaffold-DbContext "Server=[server];Database=[database_name];Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir [output_folder_name]