.NET 7 & Entity Framework 7: Mastering ALL Database Relationships (1:1, 1:n, n:n) with SQL Server 🚀

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

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

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

    🚀 Join the .NET Web Academy with a 30% discount - closing soon!
    👉 www.dotnetwebacademy.com/courses/academy?coupon=dnwas23yt

  • @Silverforger
    @Silverforger 17 дней назад

    This tutorial is very straightforward and does not skip both important and small details that make up the bigger picture. Thanks Patrick, I understood a lot!

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

    Just found you on RUclips by coincidence. I simply love your calm and easy way of explaining things. No hyped up background music or high arousal speaking. Just plain education. Thank you very much for this.

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

    you're the only person that makes learning .net fun, easy, and concise, I don't know how long it would've taken me to learn concepts like these without you friend. Thank you for your efforts :)

  • @SinanZen1981
    @SinanZen1981 9 месяцев назад +2

    Very helpful and easy to understand - along with your earlier video ".NET 7 Beginner Course 🚀 Web API, Entity Framework 7 & SQL". Thanks a lot and much appreciated. Also, your chilled-out style of explaning takes away some of my learning stress :)

  • @gusget
    @gusget 8 месяцев назад +1

    I gave it a try to "refresh concepts". I learned a lot of things. Amazing, Patrick.

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

      Thanks for your feedback! Glad I could help.😊

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

    Pretty straightforward like usual. Thank you, Patrick!

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

      Glad you liked it! Thanks a lot for your feedback!

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

    Another fantastic video and lesson!!! You are a great educator and creator! Thank you so much for this.

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

      Glad you like it. Thank you so much for your kind words! ❤️

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

    Thanks for giving it free!!!!

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

    I see TLOUS reference I give a like and subscribe.... nice tutorials by the other hand

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

    Ah, this is gonna be a fun watch later this evening. Patrick any chance for some more in depth blazor vids? Where you also go into mix and matching some custom css with tailwind.. Some fancy cart animations etc. Basically turning blazor into more than the standard enterprise look via the components hehe.

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

      Gotcha! Thanks for the suggestions. I've been curious about Tailwind too, so I might just give it a go with Blazor and make some content! 😄

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

    I really needed to understand and enhance my skills on EF CORE database mappings. Thanks to you it was made possible❤⭐️⭐️⭐️⭐️⭐️

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

    Very helpful and easy to understand

  • @de_voured8643
    @de_voured8643 Год назад +5

    This is good and I found it very helpful :) I have a small suggestion. If you create another video on this could you include an ER diagram to go along with the video to better understand the relationships? I understood what you did in this video but it would be much easier if there were a diagram to visualize the Characters, factions, and CharacterFaction's relationship.

  • @ma-arufburad8826
    @ma-arufburad8826 Год назад +1

    Well explained. Thanks man!

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

      Glad I could help! Thanks a lot for your feedback! 😊

  • @TM-pb8ky
    @TM-pb8ky Год назад

    THis helped me Alot getting started, Thank you so much!

  • @rhdhruhrhe1943
    @rhdhruhrhe1943 7 месяцев назад +1

    pls again, Really Good tutorial

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

    Great video!
    I have one question:
    Why if I do a query like this in one to many relationship doesn't throw exception in ef core but with linq to object throws:
    Suppose I have one object with many serial numbers, because the current serial number is only the last but the table is the historical too,and I want to filter what object has the serial number but only among the most recent of every object, so I did a query like this:
    Context.Objects.Include(o=> o.SerialNumbers.Where(s=> s.TypeId==2)).Where(s=> s.SerialNumbers.OrderByDescending(s=>s.Date).FirstOrDefault().Value == passed serial number). FirstOrDefault()
    I did an include with condition, but in the where clause I expected that the FirstOrDefault().Value throws exception where the FirstOrDefault () results null, but in ef core this doesn't happen.
    There is a explanation to this?
    Sorry for my english and my long question, I hope it is clear what I meant to do.
    Thanks in advance

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

    Thank you so much! It helps

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

    Loved this video but I got a little lost on the controllers part. I understood that you just wanted to demonstrate basic functionality, but do you have a video either on RUclips or Udemy on building out the services, DTOs, and controllers for the different database relationships? I think I could probably do it having watched one of your API a videos but I’m not sure I would do it in a way that enforces best practices. I would have liked a lot more time showing how to build out the best practices way.
    I know the controller should just call the service so there shouldn’t be queries in the controller, but I’m not yet familiar with DTOs and how to use them in the controllers/services. And if we use DTOs, we somehow wouldn’t need JsonIgnore right?

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

    You help me a lot, thx man, i really appreciate your content. Love from Brasil

  • @534-w4u
    @534-w4u Год назад

    Very nice explained topic. Thank you Patrick for your work 💯

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

    thank you alot, 2:57 about sql , i prefer to use a docker image/container

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

    Hi @PatrickGod, thanks for sharing your knowledge....i have one question, do you know how can I implement a CRUD service using SQlite when there's relations between tables. Thanks a lot again and congratulations...

  • @jr.ziegler
    @jr.ziegler 10 месяцев назад

    It would be nice to see how do you deal with for many-to-many relationship update

  • @mqtthias
    @mqtthias 11 дней назад

    How do I add something from "the other side"? If I want to create a weapon, how do I do that?

  • @SalmanShafiq-y3q
    @SalmanShafiq-y3q 8 месяцев назад

    Amazing Patric ❤
    Would you please make video on Ef Core Fluent API with relationship and referential integrity?
    very lest resource on that.

  • @maher_a._alzoubi
    @maher_a._alzoubi 10 месяцев назад +1

    thank you so much 😊

  • @rishukumar7586
    @rishukumar7586 26 дней назад

    you don't really need to install ef core package since sql server package internally depends on that i feel 🤔

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

    Love the The Last of Us example😊

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

    Thanks for another greate video!

  • @nazeehharfoush7069
    @nazeehharfoush7069 6 месяцев назад +4

    This explanation is not for mastering relationships, but only for beginners. You cannot build large projects with this information. In my opinion, the best explanation for EF Core is the documentation on the Microsoft website. Thank you I appreciate your hard work and effort.

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

      I absolutely understand what you are saying. I am a beginner and this video is soo helpful! I also find the Microsoft documentation very helpful, but I only understand about 20-40% of what I read usually. Of course, that is due to my own lack of knowledge and understanding. I am curious though, if you wouldn't mind, just listing a few items I should learn more about if I were to create a larger project? Thank you - and I hope this comment comes across friendly, as that is my intention. Thanks!

  • @Shanks-at-Work
    @Shanks-at-Work 9 месяцев назад

    [16:38] There was no migrations.design file created. Which version of EF is being used here ?

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

    thanks, but how can i stop cascade on delete? i mean like i have Employee data which have JobPositionId on it. i dont want if i delete a jobposition, all the employees which have JobPositionId on it got deleted too

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

    is there no longer an easy way to just make a mapping file like old entity 6 wher you just make a file, choose tables, views, etc and its done? its all manual now?

  •  Год назад

    The trickiest relationship to configure in EF core is the one with the same talbe, for example, a user that has followers and that follows other users.

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

      I don't think that's possible as that is a many to many relationship. You need a 2nd table to store that
      Unless you're using comma separated list in a column in the user table it may be possible, but you should definitely avoid that!

    •  Год назад

      @@dputra you have to add a property List following and a List followers and configure it in the dbcontext with fluent api. It is possible, but real tricky

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

      @ but how do you store the relationship? A user can follow many people, and many people can follow a user. You can configure wherever the property is, but I can't imagine having n:n relationship with just a single table. You still need an intermediate table even if it's not mapped by your ORM to an object.

    •  Год назад

      @@dputra EF core will create a relationship table for the many to many relationship. You don't have to create it yourself. The problem is configuring two forigner keys to the same entity... that's tricky.

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

    Please make another with PostgreSQL too

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

      @zoiobnu I was able to do this tutorial using just Npgsql.EntityFrameworkCore.PostgreSQL instead of the equivalent Microsoft.EntityFrameworkCore.Mssql package and it worked fine. The only other change was the connection string which depends on what you set up for your PostgreSQL server.

  • @AnNguyen-so4qo
    @AnNguyen-so4qo Год назад

    can you explain why your rows are duplicated? Thank you

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

    Hi Patrick,
    Excellent tutorial I have question Do you have in udemy course about Net Maui blazor app?

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

    I see, you love TLOU ;-) Than you for this cool and interesting video :-)

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

      Absolutely! 😁 Thank you for your feedback!

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

    Thank you

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

    How did EF figured out that backpack will hold reference of character and not the other way? This is because the code for both of the classes is same. See at 12:25 to 13:19.

  • @ЛёнькаАрхипов
    @ЛёнькаАрхипов Год назад

    Hi, it would be cool if you created a lesson on MAUI. How to create an extensible ProgressBar

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

    Nice

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

    Do you have a cource in udemy about blazor? too

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

      Here you go: ruclips.net/video/d8LObmppBdw/видео.html

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

    how character : weapon is 1:M?

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

    If i try to execute the command: "dotnet ef database update," -> the build succeeded, but in the end i have an error -> Error Number:262,State:1,Class:14
    CREATE DATABASE permission denied in database 'master'.
    can someone help?

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

    thanks dooood

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

    Sehr gutes Video, aber wie bei den meisten diese grauenvolle MsSQL DB. Ich nutze lieber Docker und dann Postgresql oder MySql, aber das spielt ja zum Glück bei EF keine Rolle.

  • @orhanaliyev9774
    @orhanaliyev9774 8 месяцев назад +10

    I expected different options for relationships, including alternative keys, but in fact, vague content without explanations in the style of the Soviet army “do it and don’t think about it!!” My friend, if you called a video about relationships, then at least try to explain what you are doing and why and what is the alternative, for example, what is bad and what is good about the approach of two entities in one table, etc. Well, it’s just not serious, 50% of the video is miraculously reset to zero the database and again and again entering records into it. I rate 2 Bidens out of 10 Bidens for this “educational” video

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

    🔥🔥🔥🔥

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

    Migration is not working on my end

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

    this doesnt work with IdentityDbContext :/

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

    I still prefer using TSQL to perform CRUD operations on databases as it makes project integration faster, and it is difficult to determine whether an engineer has database experience when using EF too frequently. Although there are many TSQLs in government projects, their efficiency is not good enough, but the use of CHATGPT to improve their efficiency has yielded the most realistic results.

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

      Do you know a RUclips tuto on how creating or improving a TSQL request using ChatGPT ? Thanks.

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

    Great job. What about many to one?

  • @holmes-jnr1822
    @holmes-jnr1822 Год назад

    surely i'm not the only one that thought of American schools in the one to many examples 😂

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

    Plzz add put request 🙏 also

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

    It doesn't work, zero value of this tutorial...

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

    do u have discord sir parick god?