Solution given by Mike worked for me with no problem. A bit of elaborated answer is here based on the answer of Mike.
Scaffold-DbContext "Server={{Server name}};Database={{Database name}};User ID={{Login}};password={{Password}}" Microsoft.EntityFrameworkCore.SqlServer -OutputDir {{Folder name}} -Force
- Folder name : Folder name under the project. The folder must have to created before executing this command.
Sample
Scaffold-DbContext "Server=.;Database=EmployeeDB;User ID=sa;password=12345" Microsoft.EntityFrameworkCore.SqlServer -OutputDir "./EmployeeDBModel" -Force
In case you are not using SQL Server authentication please refer to the answer given by Mike.