Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I add tables in EF Core/database first in the package manager console?

I'm using EF Core and was able to scaffold the initial database and table:

Scaffold-DbContext "connection-string" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models -Tables TestTable

But I can't seem to find out how to add tables after the initial scaffold.

like image 394
ernest Avatar asked Jan 24 '26 23:01

ernest


1 Answers

Run the command again to update the DbContext. You could make a bat file to run the command for you. That would make it a bit easier in the long run

like image 58
Søren Lorentzen Avatar answered Jan 28 '26 20:01

Søren Lorentzen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!