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 😊

Комментарии • 62

  • @duyoanuc5966
    @duyoanuc5966 Год назад +4

    Perfect. This is what I have been looking for. Thank you for saving us !

  • @АнтонКоншин-й7э
    @АнтонКоншин-й7э 4 месяца назад

    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.

  • @ravs234
    @ravs234 Год назад +3

    Absolutely precise and very simply explained. Thank you :)

    • @RDT
      @RDT  Год назад

      So kind of you 🙏

  • @hosseinrostami7708
    @hosseinrostami7708 Год назад +1

    Complete and right to the point. Works like a charm. thanks.

    • @RDT
      @RDT  Год назад

      Glad to hear it helped 😎

  • @chairmakerPete
    @chairmakerPete 2 месяца назад +2

    Really helpful - thank you!

  • @berthold9582
    @berthold9582 23 дня назад +1

    Très facile
    Merci sir

  • @thangamanieraniyan4923
    @thangamanieraniyan4923 Год назад +1

    Thankyou, this is exactly what i am looking for. scaffold... is it is... :)

  • @meowaves
    @meowaves Месяц назад +1

    It works. Just make sure you open the Nuget Package Manager console and not the Developer Powershell which got me into limbo.

    • @meowaves
      @meowaves Месяц назад +1

      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

  • @vallmi4370
    @vallmi4370 Месяц назад +1

    Thx a lot!

    • @RDT
      @RDT  20 дней назад

      Welcome!

  • @EnriqueMartinezInter
    @EnriqueMartinezInter Год назад

    Glad to see you back!

    • @RDT
      @RDT  Год назад +1

      Thanks Enrique! Hope to get back into it this year… thanks for sticking with us 😎

  • @simonroyjonesuk
    @simonroyjonesuk Год назад

    Absolutely perfect. Exactly what I wanted. Thanks

    • @RDT
      @RDT  Год назад

      Glad it helped 🙂

  • @NickFletcher-gb9ne
    @NickFletcher-gb9ne 9 месяцев назад +1

    Thanks very much, that was a great help.

    • @RDT
      @RDT  9 месяцев назад

      Glad it helped

  • @yasincnar166
    @yasincnar166 25 дней назад +1

    Thanks a lot

    • @RDT
      @RDT  20 дней назад

      Happy to help

  • @rogeriolima8152
    @rogeriolima8152 Месяц назад

    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.

  • @ibrarhussain1425
    @ibrarhussain1425 6 месяцев назад

    Works like a charm. thanks!

  • @abhishekrandhir3922
    @abhishekrandhir3922 Месяц назад

    Helpful for me. Thank you

  • @abugsbunny
    @abugsbunny Год назад

    Thanks for tutorial. From Latvia

  • @cogivuioay9283
    @cogivuioay9283 Год назад +1

    Thanks Roberts

    • @RDT
      @RDT  Год назад +1

      You are very welcone

  • @viniciusvilela6695
    @viniciusvilela6695 Год назад

    Thank you so much for this content, very clear and usefull

    • @RDT
      @RDT  Год назад

      Glad it was helpful 🙏

  • @albertokalman1991
    @albertokalman1991 2 месяца назад +1

    Good, thanks

    • @RDT
      @RDT  Месяц назад

      Thank you too!

  • @l.piekha100
    @l.piekha100 Год назад

    this is way more effective than using fluent API in my experience, less bugs and better consistency.

  • @berthold9582
    @berthold9582 23 дня назад

    Sir, do you have a video on transactions in C#?

  • @eleojoadegbe
    @eleojoadegbe 2 месяца назад

    Thank you

  • @bojdeep
    @bojdeep Месяц назад

    Nice, How to update the model classes if there is any changes in Database column changes

  • @TiOnGY
    @TiOnGY 3 дня назад

    After we got the model we can use it to migrate the tables to another table?

  • @yasirirfan5262
    @yasirirfan5262 3 месяца назад

    thank you.

  • @komrondeveloper
    @komrondeveloper 4 месяца назад

    Thanks

  • @KevinMullarkey
    @KevinMullarkey 3 месяца назад +1

    What if you only want to build from certain tables and not ALL tables & views?

  • @dev2devops
    @dev2devops Год назад +3

    After doing scaffolding from the existing database if we make further changes in database objects then how we can update models again?

    • @spencersedano
      @spencersedano 3 месяца назад

      I have the same question, did you get the answer?

  • @jesusospino7897
    @jesusospino7897 2 месяца назад

    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

  • @godfather7695
    @godfather7695 10 месяцев назад

    Thnks!!👍👍

  • @sherlockholmes1121
    @sherlockholmes1121 Год назад

    Nice !

    • @RDT
      @RDT  Год назад

      Thanks!

  • @soyponchoc
    @soyponchoc 7 месяцев назад

    I have a question, how can I do to map the stored procedures as the previous version of EF

  • @tobiogunsanya9142
    @tobiogunsanya9142 Год назад

    Nice. Did you create the CompanyDbContext before running the command?

    • @RDT
      @RDT  Год назад +1

      No, it is all created by the command. Basically a blank project to start with.

  • @Theo-sf8qn
    @Theo-sf8qn 7 месяцев назад

    FLACO VOS SOS EL SOL

  • @robertocarlosgalicialopez3011
    @robertocarlosgalicialopez3011 Год назад

    donde están los scripts para solo copiar y modificar ?

  • @Kennerdoll
    @Kennerdoll Год назад +1

    im getting "Build Failed'

    • @_its_ak_3839
      @_its_ak_3839 6 месяцев назад +1

      did you solved that issue ? if so please explain am facing the same issue

    • @Kennerdoll
      @Kennerdoll 6 месяцев назад

      @@_its_ak_3839 no i didnt and i stoped from there

  • @puletshehla4305
    @puletshehla4305 9 месяцев назад

    I'm facing timeout issues

    • @jingsun7604
      @jingsun7604 7 месяцев назад

      Same here. Did you find a solution for the timeout issues?

  • @sashamaksyutenko7169
    @sashamaksyutenko7169 2 месяца назад

    hi. How can I use it on Mac?

  • @berthold9582
    @berthold9582 23 дня назад +1

    Très facile
    Merci sir

  • @ruslanzorkin784
    @ruslanzorkin784 5 месяцев назад +1

    Thanks a lot!

    • @RDT
      @RDT  5 месяцев назад

      Welcome!