EF Core 7 🚀 Multiple Databases, DbContexts & Relationships (Entity Framework 7)

Поделиться
HTML-код
  • Опубликовано: 27 ноя 2024

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

  • @davidarayacadiz7675
    @davidarayacadiz7675 Год назад +2

    I'm from Chile, I found your channel about 3 days ago and currently, I'm developing a .NET 7 web API for college and your videos were so helpful! Thank you so much.

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

      Thanks a lot for your feedback, David! Really glad I could help! 😊

  • @mtranchi
    @mtranchi Год назад +7

    5:58 You can specify the output directories with a "-o" parameter. It doesn't even have to be in the Migrations folder.

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

      Hey there! You're absolutely right. Thanks for pointing that out. 😊

  • @The-Z-Zone
    @The-Z-Zone Год назад

    Great tutorial. Most EF examples that I have seen have always been a 1:1 between app and database so this was nice to see in operation.

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

    I was searching for this topic in the past few months. Thanks!

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

      Welcome! Glad I could help! 😊

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

    Cheers Patrick! Great job

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

      Thank you so much, Darren! 😀

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

    I was searching for a video on this topic. Thank you so much.

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

      Glad I could help! 😊

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

      @@PatrickGod Can you show us how we can manage JWT, like revoking and refreshing, in a web API app?

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

    You can specify the folder where the migration goes. I find that handy to keep everything well organized

  • @joaogabrielv.m328
    @joaogabrielv.m328 Год назад +1

    Thanks a lot for the video, God. Keep up

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

    nice video... For anyone thinking about writes to multiple dbs - Saga

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

    It would be great if your next topic would be 2 DBContexts (Config, AppData) where the connection string for the second one(AppData) is stored in the first Database(Config). For a sharded multi-tenant example.

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

    Thanks a lot always for the video!. It would be great if you can make a topic about ef core with multithreading

  • @alexmadnix
    @alexmadnix Год назад +2

    Thanks God!!

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

    Thanks that was really helpful.

  • @PhantasyAI0
    @PhantasyAI0 8 месяцев назад

    Is this still the case in .net 8? meaning you have to do it manually?

  • @MohammedAlshaer-y3h
    @MohammedAlshaer-y3h Год назад

    Patrick good tutorial you can make the relation between the user table and character table in view model table rather the in the actual user model

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

    Hey there! Thank you for the video!
    Is it worth creating multiple DbContexts at all, and is it worth separating IdentityDbContext into a separate database? Does anyone actually do this in real projects?

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

      Yes, it is worth because authentication and authorization are abstracted from business logic. But in this case scenario i would create a "UserTableInfo" in the characters dbcontext. Imagine if you want to get all the characters and their users, in this example you ll have to foreach loop all characters asking for theirs users. Multiple database queries.
      So whenever a user gets registered in one database you can add some userinfo in the characters userinfo table (other database), such as name,email, etc no sensitive info like passwords, etc so you can map faster with a simple Join

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

    What for we will need few contexts?

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

    can we use this for switching of database? for example --user1 registered in DB1, user2 registered in DB2 --when they login they will be connecting automatically in their registered DB.. is it possible here?

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

    is it possible to use multiple dbcontext in entity framework core that can share some tables such as Tenant, User, etc. in both context, but want to create table only from first context's migration,
    btw: I have one database, and I want to use different scheema. such as shared.tableName, sales.tableName, etc. actually I want to make moduler monolith application.

  • @hero1v1
    @hero1v1 11 месяцев назад

    How to add a Generic Repository pattern on top of this?

  • @10Totti
    @10Totti Год назад

    Migrations is possible now also with Visual Studio UI.

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

    It would be better showing multi-tenancy application where users/customers have each their own dbcontext using same app. Think of something like quickbooks. It's not realistic to have diff dbs in this case videos games

  • @luisfernandodeolazabalsche3317

    😃😃😃😃😃