Create an EF Core Model from Database First (Scaffold DB Context)
HTML-код
- Опубликовано: 15 сен 2024
- How do you create an Entity Framework model from an existing SQL database (database first?) In this video I’ll show you how to use the Scaffold DB Context tool available with EF Core to do just that and save tonnes of time.
☕️ Support us with a coffee! (Or.. beer 🍺)
www.buymeacoff...
📧 📫 Join us on our developer journey! Sign up to our email newsletter:
robertsdevtalk...
🐦 Follow us on Twitter:
/ robertsdevtalk
🎶 Music by Epidemic Sound:
www.epidemicso...
Icons in this video kindly provided by FlatIcon from Freepik
www.freepik.com
www.flaticon.com
Disclaimer - some of our links are affiliate links, which means that we receive a small commission for any sales made via those links, at no extra cost to you - so a great way to support our channel! Thank you so much for your support 😊
Perfect. This is what I have been looking for. Thank you for saving us !
I'm leaving a like under this video not because it's relevant to me, but because the author saved my valuable time with an introduction to the topic of the video. Thank you so much.
Absolutely precise and very simply explained. Thank you :)
So kind of you 🙏
Complete and right to the point. Works like a charm. thanks.
Glad to hear it helped 😎
Really helpful - thank you!
Très facile
Merci sir
Thankyou, this is exactly what i am looking for. scaffold... is it is... :)
It works. Just make sure you open the Nuget Package Manager console and not the Developer Powershell which got me into limbo.
Also, if you are working with multiple repository and would want to move the models to specific project then you add -Project "YourProjectName" command as below :
Scaffold-DbContext -Connection "ConnectionStrings" -Provider Microsoft.EntityFrameworkCore.SqlServer -Project "YourProjectName" -OutputDir Models -Context ProjectDbContext
Thx a lot!
Welcome!
Glad to see you back!
Thanks Enrique! Hope to get back into it this year… thanks for sticking with us 😎
Absolutely perfect. Exactly what I wanted. Thanks
Glad it helped 🙂
Thanks very much, that was a great help.
Glad it helped
Thanks a lot
Happy to help
Nice video, thanks. A real world project idea using EF with tricks
would be nice. I am learning how to use it. DB First... Code First probably I will never use.
Works like a charm. thanks!
Helpful for me. Thank you
Thanks for tutorial. From Latvia
Thanks Roberts
You are very welcone
Thank you so much for this content, very clear and usefull
Glad it was helpful 🙏
Good, thanks
Thank you too!
this is way more effective than using fluent API in my experience, less bugs and better consistency.
Sir, do you have a video on transactions in C#?
Thank you
Nice, How to update the model classes if there is any changes in Database column changes
After we got the model we can use it to migrate the tables to another table?
thank you.
Thanks
What if you only want to build from certain tables and not ALL tables & views?
After doing scaffolding from the existing database if we make further changes in database objects then how we can update models again?
I have the same question, did you get the answer?
I am using Docker to have the SQL Server, when I run the command line to generate lps models with scafffold this gives me errors with the user or sometimes with the certificate
Thnks!!👍👍
Nice !
Thanks!
I have a question, how can I do to map the stored procedures as the previous version of EF
Nice. Did you create the CompanyDbContext before running the command?
No, it is all created by the command. Basically a blank project to start with.
FLACO VOS SOS EL SOL
donde están los scripts para solo copiar y modificar ?
im getting "Build Failed'
did you solved that issue ? if so please explain am facing the same issue
@@_its_ak_3839 no i didnt and i stoped from there
I'm facing timeout issues
Same here. Did you find a solution for the timeout issues?
hi. How can I use it on Mac?
Très facile
Merci sir
Thanks a lot!
Welcome!