C#C
C#3y ago
Vyrania

❔ Database with SQL (coming from a Rails background)

So for those that don't know Rails, we generate our model like this

rails g model product name:string
(just one attribute for the example)

Then in the console we go
rails db:migrate


once the database is migrated, we enter the Rails console and start populating it. Here's an example.

Product.create(name: "Sweater")


Lo and behold. That just created a new product called "Sweater" and it's now in the database.

My question is can you do the same thing in the console with C# and ASP.NET?
Was this page helpful?