Reputation: 11
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.
Upvotes: 0
Views: 231
Reputation: 11
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
Upvotes: 1