Quantcast
Channel: How to update the model when using database first approach - Stack Overflow
Viewing all articles
Browse latest Browse all 11

Answer by Sajeeb Chandan Saha for How to update the model when using database first approach

$
0
0

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.


Viewing all articles
Browse latest Browse all 11

Trending Articles