Relationship Mapping in Entity Framework & .NET 7: One-to-One, One-to-Many, Many-to-Many

Поділитися
Вставка
  • Опубліковано 10 гру 2024

КОМЕНТАРІ • 44

  • @CodeUnparalleled
    @CodeUnparalleled  Рік тому

    Looking for Coding Mentoring? If you're seeking personalized guidance and mentoring for your coding journey, check out my Fiverr gig! I offer expert guidance and support to help you level up your programming skills. Visit www.fiverr.com/s/rL3P3K to book a session and accelerate your coding career.

  • @cirusMEDIA
    @cirusMEDIA Рік тому +1

    Nice and clear explanation, thanks!
    I noticed that: @12:23 ...in .NET 7....if we use migrations to create database objects from our models,
    then the Foreign Keys (eg AuthorId) will automatically be included in the table(Book) as a result of the 1to1 relationship identified by 'public Author Author{get; set;}'

  • @muttBunch
    @muttBunch Рік тому

    Thank you, this helped me understand what many of the issues I was running into in my case. I have many to many of many many's in a join table lol :D

  • @chandruts.2579
    @chandruts.2579 6 місяців тому +1

    Very helpful. Excellent! Thank you.

  • @gatocode316
    @gatocode316 2 місяці тому +1

    beautiful class

  • @kvelez
    @kvelez 2 місяці тому +1

    Cool video.
    Do more for .NET 9

  • @ronaldjohnson4470
    @ronaldjohnson4470 10 місяців тому

    Excellent tutorial, thank you.

  • @codewithgilly
    @codewithgilly Рік тому +1

    Great Stuff

  • @techsolve9397
    @techsolve9397 23 дні тому +1

    can you make the video of blazor server UI implementing this?

  • @shanmukhapatil7131
    @shanmukhapatil7131 Рік тому +3

    keep adding new videos

    • @CodeUnparalleled
      @CodeUnparalleled  Рік тому

      Thanks for the encouragement

    • @shanmukhapatil7131
      @shanmukhapatil7131 Рік тому

      Could u make videos on fluent api?
      There are no good videos on that, you can have a playlist for that, and it's really necessary in production level application

    • @CodeUnparalleled
      @CodeUnparalleled  Рік тому

      Sure

  • @sayyorapardaeva5185
    @sayyorapardaeva5185 Рік тому +1

    Can you show how to create controller methods too, please?

  • @ashrafulislam6209
    @ashrafulislam6209 8 місяців тому +1

    thanks

  • @mariusenache6658
    @mariusenache6658 10 місяців тому +2

    controllers?

    • @CodeUnparalleled
      @CodeUnparalleled  9 місяців тому

      I will have to a video on that.
      What would you like to see?

  • @mateusdossantos6053
    @mateusdossantos6053 11 місяців тому

    the hasone publisher with withone author shoud'nt be at publisher rules too? 11:54

    • @CodeUnparalleled
      @CodeUnparalleled  9 місяців тому

      I really do not see the need as one side is enough to enforce the relationship

  • @liamdesmond2560
    @liamdesmond2560 Рік тому +1

    Hey, thanks for the video. I do have a few questions though.
    How you come you only parameterized .HasForeignKey on line 25 of the AppDbContext and nowhere else?
    You only did it in the ModelBuilder for Author.
    Also, regarding the 1:1 relationship with Author and Publisher. Do you only have to do the mapping on one side? Because I don't see .HasOne.WithOne for the Publisher ModelBuilder.

  • @nomanyatogami
    @nomanyatogami 9 місяців тому

    nice tutorial but I wish you could show the values returned by the api's

  • @ronaldjohnson4470
    @ronaldjohnson4470 10 місяців тому +1

    The tutorial seems to be incomplete. what about the controller, you never mentioned it at all. Do we need a Book Controller, Author Controller and a Publisher Controller. ?

    • @CodeUnparalleled
      @CodeUnparalleled  10 місяців тому

      Perhaps a follow up video. This one was focused on the relationships

  • @MSSherchandra
    @MSSherchandra Місяць тому

    please share Dto page and Service Page Code

    • @CodeUnparalleled
      @CodeUnparalleled  Місяць тому

      I might need to find a way to share as that code base is only available for patreon subscribers for this particular video

  • @arturg6771
    @arturg6771 Рік тому +1

    👍

  • @rrdfx1510
    @rrdfx1510 Рік тому

    hello Sir thanks for this tutorial, can you make part 2, where you will insert some data in to those entities especially in many to many table and how to use them like on real world, becuase im creating them but I dont know how to use many to many realtion to fetch data, please consider my comment I need this content.

  • @9dgalo
    @9dgalo 8 місяців тому +1

    Are you trying to teach something here?? People don’t waste your time, you are not gonna learn a thing.
    This is not a tutorial… I just a kind of “watch me doing this and learn nothing”. Absurd…

    • @CodeUnparalleled
      @CodeUnparalleled  8 місяців тому

      I am sorry you feel that way and I didn't meet your expectations.

  • @torrvic1156
    @torrvic1156 Рік тому +2

    Unfortunately sir your video have some drawbacks. It lacks explanations, you speak way too fast and not very clear, there are many foreign sounds (burps, cars roaring, even something like farts) which makes it even more difficult to understand. But otherwise thanks!

    • @CodeUnparalleled
      @CodeUnparalleled  Рік тому +1

      Thanks alot for the feedback. I would need more clarification on the lack of explanation, I will address the way I speak in the next video.
      For the foreign sounds unfortunately its the material I am using . I have a patreon page where I urge those that can support sign up so that better equipment can be purchased for optimum quality.
      Thanks once again

    • @torrvic1156
      @torrvic1156 Рік тому +1

      @@CodeUnparalleledthanks for the answer sir! In my opinion you probably should tell more about all of this types of relationships so it will be more clear for your spectators as to what are you trying to achieve. Maybe you should show some schemes and diagrams.

    • @dzyannleleur352
      @dzyannleleur352 7 місяців тому +1

      @@CodeUnparalleled People are always going to complain, like the people saying you should explain about the controller. You didn't say you were going to explain anything about controlles in this video. However torrvic1156 is right, your video has drawbacks. Speaking fast can be a problem, but I believe you are speaking maybe to close or too far from the microphone so it is hard to understand what you say. If your voice is clear the speed is not so much a problem because you can speed it up or slow it down with youtube controls. I tried to speed up your video and it becomes almost impossible to understand. I can usually listen to people speak at 2x and understand pretty much everything, I had a hard time with your video at 1.5x so I had to slow it down.
      Regarding noise, the worst really is how you use your keyboard, you should stop hitting it like you hate it. It is bad for the health of your fingers, and for the people listening.
      To improve your video you could do a simple intro saying what you want to achieve, maybe with a diagram like Torvic said, why you want to achieve it or usual issues, and then achieve it. So for example "in this video we are going to map this 3 types of relationships and we are going to use this entities as example". Then you show a diagram of the entities and their relationships. You also explain why you model it that way. If you check your video 9 minutes pass and you haven't touched yet on what is supposed to be the main subject of the video.
      I came to this video to refresh knowledge I already had, so I didn't have a hard time understanding it. But this is a basic kind of knowledge that you should expect people with little background on it will try to learn. So you should gear your video to those people. Add a bit more of structure. And fill it with content. If you review it you will see the video has about 24 mins, but actual useful content is thin and spread out.

    • @CodeUnparalleled
      @CodeUnparalleled  7 місяців тому +2

      @dzyannleleur352 thanks alot for your insight . Will take it to heart and improve in the upcoming videos.

    • @dzyannleleur352
      @dzyannleleur352 7 місяців тому +1

      @@CodeUnparalleled I think you have a great attitude and I wish you success. Teaching is not easy and despite its flaws you can get valuable info from your video.