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

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 พ.ย. 2024

ความคิดเห็น • 76

  • @PatrickGod
    @PatrickGod  ปีที่แล้ว +2

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

  • @ronrondk
    @ronrondk ปีที่แล้ว +3

    Just found you on TH-cam 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.

  • @Silverforger
    @Silverforger หลายเดือนก่อน

    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!

  • @azizhmidi5835
    @azizhmidi5835 7 หลายเดือนก่อน +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 :)

  • @gusget
    @gusget 9 หลายเดือนก่อน +1

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

    • @PatrickGod
      @PatrickGod  9 หลายเดือนก่อน

      Thanks for your feedback! Glad I could help.😊

  • @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 :)

  • @eddyelamin9015
    @eddyelamin9015 3 หลายเดือนก่อน +1

    Pretty straightforward like usual. Thank you, Patrick!

    • @PatrickGod
      @PatrickGod  3 หลายเดือนก่อน

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

  • @michaelrafales2782
    @michaelrafales2782 4 หลายเดือนก่อน +2

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

    • @PatrickGod
      @PatrickGod  4 หลายเดือนก่อน

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

  • @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 4 หลายเดือนก่อน

      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!

  • @sergkapitan2578
    @sergkapitan2578 2 หลายเดือนก่อน +2

    Thanks for giving it free!!!!

  • @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! 😄

  • @davealma88
    @davealma88 7 หลายเดือนก่อน +1

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

  • @kopilkaiser8991
    @kopilkaiser8991 ปีที่แล้ว

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

  • @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.

  • @mouradaissani8957
    @mouradaissani8957 ปีที่แล้ว

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

  • @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 TH-cam 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?

  • @jr.ziegler
    @jr.ziegler 10 หลายเดือนก่อน

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

  • @bendhiebhassen5144
    @bendhiebhassen5144 8 หลายเดือนก่อน

    Very helpful and easy to understand

  • @GattusodelCachapoal
    @GattusodelCachapoal 9 หลายเดือนก่อน

    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...

  • @MegaTonyBR
    @MegaTonyBR ปีที่แล้ว

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

  • @TM-pb8ky
    @TM-pb8ky ปีที่แล้ว

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

  • @rhdhruhrhe1943
    @rhdhruhrhe1943 8 หลายเดือนก่อน +1

    pls again, Really Good tutorial

  • @ma-arufburad8826
    @ma-arufburad8826 ปีที่แล้ว +1

    Well explained. Thanks man!

    • @PatrickGod
      @PatrickGod  ปีที่แล้ว

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

  • @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

  • @SalmanShafiq-y3q
    @SalmanShafiq-y3q 9 หลายเดือนก่อน

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

  •  ปีที่แล้ว

    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.

  • @maher_a._alzoubi
    @maher_a._alzoubi 10 หลายเดือนก่อน +1

    thank you so much 😊

  • @534-w4u
    @534-w4u ปีที่แล้ว

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

  • @dfmf1982
    @dfmf1982 ปีที่แล้ว +1

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

    • @PatrickGod
      @PatrickGod  ปีที่แล้ว

      Thank you! Not yet.

  • @rishukumar7586
    @rishukumar7586 หลายเดือนก่อน

    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😊

  • @suryasuresh1106
    @suryasuresh1106 6 หลายเดือนก่อน +1

    Nice

  • @okanbayulgen
    @okanbayulgen ปีที่แล้ว

    Thank you

  • @orhanaliyev9774
    @orhanaliyev9774 8 หลายเดือนก่อน +11

    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

  • @Shanks-at-Work
    @Shanks-at-Work 9 หลายเดือนก่อน

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

  • @ЛёнькаАрхипов
    @ЛёнькаАрхипов ปีที่แล้ว

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

    • @oktjona
      @oktjona ปีที่แล้ว

      true

  • @andyhuggan3036
    @andyhuggan3036 ปีที่แล้ว

    Thanks for another greate video!

  • @mqtthias
    @mqtthias 27 วันที่ผ่านมา

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

  • @AnNguyen-so4qo
    @AnNguyen-so4qo ปีที่แล้ว

    can you explain why your rows are duplicated? Thank you

  • @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!

  • @dfmf1982
    @dfmf1982 ปีที่แล้ว +1

    Do you have a cource in udemy about blazor? too

    • @PatrickGod
      @PatrickGod  ปีที่แล้ว

      Here you go: th-cam.com/video/d8LObmppBdw/w-d-xo.html

  • @johnkrator
    @johnkrator ปีที่แล้ว +1

    🔥🔥🔥🔥

  • @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?

  • @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

  • @henrik3098
    @henrik3098 ปีที่แล้ว

    thanks dooood

  • @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.

  • @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 TH-cam tuto on how creating or improving a TSQL request using ChatGPT ? Thanks.

  • @ieldenkeljson8235
    @ieldenkeljson8235 ปีที่แล้ว

    Great job. What about many to one?

  • @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.

  • @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?

  • @joeyestrada9071
    @joeyestrada9071 ปีที่แล้ว

    Migration is not working on my end

  • @enricoroselino7557
    @enricoroselino7557 9 หลายเดือนก่อน

    this doesnt work with IdentityDbContext :/

  • @islamicpoint__
    @islamicpoint__ ปีที่แล้ว

    Plzz add put request 🙏 also

  • @holmes-jnr1822
    @holmes-jnr1822 ปีที่แล้ว

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

  • @xoreeee
    @xoreeee ปีที่แล้ว

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

  • @BloodvinkszTV
    @BloodvinkszTV 9 หลายเดือนก่อน

    do u have discord sir parick god?