'if we update our database how we add model class in our project in database first approach EF core
When I add a new table in my database which use in my database first approach EF project I get some error and problem in my project and newly created DB wasn't attached in my project.
Solution 1:[1]
Step 1: After Create Table in Database then open you Package Manager Console
Step 2: Use the following Command for add your new table model class
Scaffold-DbContext "Server=Server name;Database=Database name;User Id=User name;Password=password;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models -Force
Step 3: Hit Enter
Note: Here only add -Force command with previous migration command
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Md Tanvir Asad |
