.NET 6 & EF Core 🚀 ALL Relationships (1:1, 1:n, n:n) with Entity Framework Core 6 & SQL Server

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

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

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

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

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

    The fact that you code and fix error live makes you an elite programming content creator!

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

      Thank you so much! Appreciate it! 😊

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

    Seeing the real world coding of encountering errors and troubleshooting just adds a better understanding to the overall subject matter - as was the case here. Thanks for the highly understandable & enjoyable content.

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

      Thank you so much Bruce, appreciate it! 😊

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

      It was interesting watching it. I just couldn't help but laugh at some point because it was so relatable :)

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

    I like the messy style of this video and that fact that you did not prepare a lot in advance. This feels lot like how I approach things and then run into the type of problems you ran into. And... I like your cussing as well, very recognizable 🙂

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

      Haha, thank you so much. Yeah, that's just the way it is. Sometimes you just don't know what problems you're going to run into. Even with supposedly simple tasks. 😅

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

      My favourite part was when he acknowledged how much easier this process would be with the proper software architecture. It is a testament to the efficacy of the architecture, his knowledge level, and the nuances of using a framework as complex as .NET.

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

    Ur the best Patrick, was googling for like 2 hours now, could not put it together, found your video, it just saved me another few hours of searching. Really helpful the live debugging from ur side. Cheers man!

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

      Thank you so much for letting me know. Really glad I could help! 😊

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

    Thank you so much for your videos!
    I can't believe how fluent and easy going are your videos. English is not my first language but your pronuntiation and your pace make it easy to understand everything.

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

      Happy to hear that! Thank you so much for your feedback! 😊

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

    This is my 1st EF tutorial, i worked only with NoSQL DBs, thought i will give it a try, this was very fun to watch! thanks.

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

      Glad you enjoyed it! Thanks a lot for your feedback! 😊

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

    I love the way you doing that tutorials. You never hide error. I really appreciate that. really interesting. Pleas don't change your Style. Thank you And Good luck brother!

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

      I appreciate that! Thank you so much for your feedback! 😊

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

    Hey really nice video Patrick! The many-to-many has tripped me up in the past so thanks for taking the time to walk through that.

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

      Glad it was helpful! Thanks a lot for your feedback!

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

    Thank you Patrick!!! I've been struggling with EF for the last two weeks.... Now I think I see the light at the end of the tunnel... :)

  • @АристархЗловредович
    @АристархЗловредович 2 ปีที่แล้ว +4

    Stumbled upon your channel by accident, great content and very clear explanations. Best regards from Azerbaijan

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

      Thank you so much! Appreciate it! 😁

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

    Gracias por tu pronunciación! No se mucho inglés pero hablas muy pausado y eso ayuda mucho para entender lo que dices.
    Ojalá tuvieras los subs en español, pero se agradece mucho tu contenido.
    Saludos desde Argentina.

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

    It was tricky to fight with dotnet ef, because I had to build the solution, the project, hahaha, until it wants to do its work right (same code). But I have learned a lot from the errors, thank you to be a fighter against errors and show them and their resolution.

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

      Thanks a lot for your feedback! Great you figured it out! 😊

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

      Thanks for the tip about build the solution, I was stuck for the moment there.

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

    Patrick, thank you for this demo. It helps me in becoming more familiar with EF!!!! P.S. I would love to see all of those "what you should do is.... " best practices :)

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

    Patrick! Everything is great:) But for those who are not familiar with this framework and some other stuff it is too heavy without little more explanaitions in the first place! Is it possible for you to expand this video or create an additional tutorial for this one as forrunner:)??? That would be great help for many people as I see also greatfule dudes in the commentaries. Some basic explanaitions would also not be too much! Thank you once again for your generosity and service!!! God bless you :)

  • @Don-ii4vm
    @Don-ii4vm 2 ปีที่แล้ว +1

    In less than a year, you've tripled your subscriber numbers.
    Well Done, Patrick.

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

    I'm from Brazil and u are helping me a lot, thanks!!

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

      Happy to help! 😊

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

    Finally found my best problem solving video. Thank you my teacher

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

    Patrick, I loved learning dotnet from you!

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

      Thank you very much! Appreciate it! ☺

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

    Wow, I can't thank you enough for all the errors that have surfaced in this video! Believe it or not, your troubleshooting with these errors actually elevates it to premium content. Embracing imperfections while learning programming makes the journey more relatable and enjoyable. This video becomes a delightful blend of education and entertainment, showing that even experts encounter challenges. Kudos to the creator for sharing real-life problem-solving, turning it into an inspiring and insightful experience. Double-tap if you agree that this video is a gem amidst the sea of polished content! 💎🎉 #ProgrammingPassion #EmbracingMistakes #PremiumContent"

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

    To solve that add error, Just change User property in Character model to be:
    public User? User { get; set; }
    the ? means optional

    • @Syberytowy
      @Syberytowy 2 ปีที่แล้ว

      it means nullable to be precise, which is quite important i think

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

    you are the obi wan kenobi of C# you deserve coffee so the force will be with you

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

      Thank you so much!!

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

    Thanks god i found you dude, awesome tutorial and btw its pretty fun to watch its because of your way to solve the issues while tutorial. Its really helps me, thanks a lot!

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

    You saved my project, I was having the same error with the foreign keys, sending the object from the client side to the API and just getting a Bad Request.
    Thanks a lot for your detail troubleshooting. =)

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

      Glad I could help! Thanks so much for your feedback! 😊

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

    And why not just have a userId FK in the Character? Why are you building Models that contain both the referrenced objects (the User property within the Character) AND their ID (the UserId)? Why should the Character contain a property of the User object? Does EF require it for the FK to be created? (I don't think so, or else the UserId would be not be needed. Makes sense?). In essence, why shouldn't just the ID of the foreign object be enough?...

    • @R5123
      @R5123 2 ปีที่แล้ว

      I had the same question. EF uses it for the foreign key to be created. They are called "Navigation Properties." They aren't loaded unless you explicitly load the relationships in your queries of the DbContext.
      That said, I am still not sure why he couldn't save the character around the 29:00 mark when he had specified the userId. Seems strange to me that you would have to run a query to find the user before adding the character entry to the database given you are supplying a valid foreign key there.

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

    I recently started to watch your videos, liked most of them.
    Please create video on .net web api solution architecture

  • @luisc1794
    @luisc1794 2 ปีที่แล้ว

    I was looking for this in a long time, how to do a save many to many relationships, you make it so easy. Thanks for all your hard work

  • @muzamilmughal-15
    @muzamilmughal-15 ปีที่แล้ว +2

    I loved your approach of using DTO but that actual error could be resolved by just making it Nullable, because for making a relationship we just need the Id of that particular object, not the complete object. Because even when using DTO we are making extra round trip to DB for getting the USER against specific userId which is not essential in this particular case.

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

    Thank you so much, it was what I was looking for. Finally some beginner friendly tutorials.

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

      You're very welcome! Glad you like it. Thanks a lot for your feedback! 😊

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

    Where you are getting a list of characters if you use Include("Users") right after the where() method, every users entity in each Character entity will be populated with the related data! Auto-magic-ally

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

    Gracias Mister Patrick......A pesar que no tiene subtítulos, se entiende....

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

      Glad I could help! 😄

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

    Lol at 33:32 "Well that was a lot of work for just creating a character" :D

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

    The error that you encountered with the POST method is EXACTLY what I was dealing with after watching your CRUD with a .NET 6 Web API & Entity Framework Core 🚀 Full Course and tailoring it along the way to my use case. Post was requiring the object and I could not for the life of me determine why.

  • @modx5534
    @modx5534 2 ปีที่แล้ว

    Great Tutorial and I nice video-Cheatsheet ^^. I just needed a refresher in ef core and some bugfixing tips for example how to deal with the json-serialization error. Your video helped me a great deal with that. Thanks!

  • @alexkal820
    @alexkal820 2 ปีที่แล้ว

    Of course its worth a like!
    good job and thank you

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

    i loved your videos. I'm learning a lot from you, thank you

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

      Thank you so much for your feedback! Glad you like them! 😊

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

    fuuuuuck, this video is amazing! binging all your content and learning so much :)

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

      Thank you so much! Glad you like it! 😊

    • @willgale7187
      @willgale7187 2 ปีที่แล้ว

      @@PatrickGod Such quality content my friend, much appreciated

  • @Gauravkumar-jm4ve
    @Gauravkumar-jm4ve 2 ปีที่แล้ว +1

    Nice.. thanks for sharing.. please keep doing more

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

      Thanks a lot for your feedback!

  • @LeandroSouza-vl7cl
    @LeandroSouza-vl7cl 2 ปีที่แล้ว +1

    You should change the title of this video to "For beginners" because it is a really junior way to work with EF.
    For something more professional in the real world, I would suggest you use Fluent API with configurators.

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

    Note: The onModelCreating is not used here explicitly. This is because a join table CharacterSkill that was implicitly created does NOT have its own unique properties. The n:n entity relationship is implicit onModelCreating. If for example, the Character that adds a skill needs to have a date or level of skill associated with him, we would explicitly add the CharacterSkill model (Composite table) with those unique properties.

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

    The only constructive feedback i have is that:
    1. You should have shown in code, how you added entities to your database, instead of doing it directly in the database. Else its been a great video.
    2. When you debug, mouse over the error you find and explain to problemshooting logic from what you are reading/seeing :)

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

      Thanks a lot for the feedback! It seems I'm too fast sometimes, in particular when I get any errors. I'll keep that in mind. 😊

    • @jeverydk
      @jeverydk 2 ปีที่แล้ว

      @@PatrickGod watching you problemsolve error was one of those things i learned most of.
      In generel was it so refreshing too see errors in a "tutorial" and i learned a bunch.

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

    How and what would you do if both Charachter and User belong to two different assemblies ? How could you reference both sides? You fall in a Circular Dependencies !!

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

    Mr God.. where was this Swagger UI thingy configured? Came out of nowhere, seems REALLY useful, and I don't think it was configured anywhere in this video.
    Do you have any resources for it?

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

    Nice video.. like your jokes :) .. BTW: as for the issue with saving the Character.. you could set User as nullifyable in the Character class.. this should also work

  • @amgad2111
    @amgad2111 2 ปีที่แล้ว

    Thanks a lot for your effort with clear and clean explanation, Patrick.
    I was just wondering if you could give some guide about getting the "User" entity with List included without it being a null value and also the process of binding them so that deleting the "User" with the user controller would also delete its related "Character"s, maybe tell me about the thought process of achieving this, it would be much appreciated.

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

      Hey there! Thanks for your feedback. I think the following article might help you regarding the delete behavior in such cases: docs.microsoft.com/en-us/ef/core/saving/cascade-delete

    • @amgad2111
      @amgad2111 2 ปีที่แล้ว

      @@PatrickGod Thanks a lot, this is really helpful to me and I really appreciate it.
      I'll be waiting for more content from you, you're doing great.

  • @khorshedhasantutul202
    @khorshedhasantutul202 2 ปีที่แล้ว

    Easy to learn
    Thanks Petrick 😃

  • @BhagirathMakwana-e1y
    @BhagirathMakwana-e1y 7 หลายเดือนก่อน

    Good explaination

  • @01pedro02pedrinho03
    @01pedro02pedrinho03 2 ปีที่แล้ว +1

    Really good content, helped me a lot, thanks!!

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

      Thank you so much for your feedback! 😄

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

    great video but i have one question the configuration code is different for .net6 and .net 7
    and can you make a detailed video on what's new in .net7

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

    You have no idea how helpful this tutorial was to me, i don't even speak english but the voice is so clear and neutral didn't needed a close captions and the errors I've been struggling lately has been solved so quick, thank you so much.

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

    LIke and subscription!!!!! Cab you create a video with the same content for those who are "left behind":))) For those who want to learn the framework , but still not that far!? There are many confusions, when it come to which combination of "tools" is better. Is MVC is still relevant in such a dev.? When is better "Code first"? And how to connect this with FRONTEND tool, ...specially as Angular :) Really many thanks!!!

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

    Thanks Mr. God.

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

      Glad I could help! 😊

  • @Deltacasper
    @Deltacasper 2 ปีที่แล้ว

    I get this error with this relationship: "Introducing FOREIGN KEY constraint 'FK_Events_Users_UserId' on table 'Events' may cause cycles or multiple cascade paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY constraints". How can I fix this?

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

    Can you film a video to explain why there is need to Create the CreateCharacterDTO in the 1 : n relationship. ; and approach to handle the 1 object to avoid the cycle reference? those seems interesting for me. Thanks.

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

    Thank you so much.

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

      You're welcome! 😊

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

    Really appreciate this,thak you!

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

    Hi Patrick, Firstly I must commend your efforts, you are doing a very good job there. I was following the video, and I got stuck at the many to many relationship part. I have created a class for skills, and added the List of skills to my character class also, but when I run the ef migrate command, I only get the skills table, I do not get the combined table of skills and character. Is there something I am doing wrong?

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

    Do you know how can I add another field to the CharacterSkill table?

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

    Thanks God !

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

    Thanks!

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

      Wow! Thank you so much! 😀

  • @bendesimt
    @bendesimt 2 ปีที่แล้ว

    Nice tutorial but it would have been really nice if you told us that we need to install Microsoft SQL express server in order for the database to work. It's kind of obvious now but I wasted a lot of time trying to understand why the database wasn't working.

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

    Completed!

  • @sagarmajumdar92
    @sagarmajumdar92 2 ปีที่แล้ว

    Hi Patrick
    Weapon has character and characterid . Character has user and userid.
    When you added a new Character you added the userid and not user but when you added the weapon you added the character and not the characterid (at 46:00) . Why is this different ?

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

    Gracias mister patrick se entiende a pesar que no esta activado los subtitulos :(

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

    but how we can use this concept with angular? I know you talked about backend relationships here but how is it going to help in frontend ?

  • @santosh.nextbuild
    @santosh.nextbuild 2 ปีที่แล้ว

    If both tables have primary key is string datatype, it is not working. why? And how do you work?

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

    when talking about fighting sticks it would be staff. like jo-staff, bo-staff etc. the other accepted term is Stave. well stave is typically the plural term for many staff items, it is acceptable to use stave as both singular and plural. Some DMs i have played with refer to magic sticks as staves and fighting sticks as staffs. so really just preference in my book. Also love the Dragonlance nod.

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

    Thank you so much !

  • @GameGame-kl6bs
    @GameGame-kl6bs 2 ปีที่แล้ว +1

    As always valuable contents

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

      Thank you so much! 😊

  • @Wada-Channel
    @Wada-Channel ปีที่แล้ว

    Hi, great video! I'm a newbie. Could you please suggest if it would be a good idea to create a WinForms app that interacts with a Web API, with the possibility of developing another frontend for a mobile app if needed

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

    I thing that's awful, sorry. I going to yt to see correct example with ef6, another side, i see how to guy trying make working code and in the end it doesn't look like correct decision. i hope you understand about what i say

  • @بيبروفيسورفيالرياضيات-ض1ج

    thanks great video
    I want ask in 23:57
    why user is null?

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

    Hy,really love your videos.
    Just one question: which presentation software are you using for your slides really love it.

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

      Thanks a lot! I use "Canva" for the slides. Enjoy! 😊

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

    Thanks Patrick a lot but can you add the auto generated subtitles English pls, it make non-native English speakers easier to follow.

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

    The protected override void OnModelCreating(ModelBuilder modelBuilder) method is not necessary ?

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

    Can you create a video on database first approach.

  • @surprisedduck6750
    @surprisedduck6750 2 ปีที่แล้ว

    Do you have any videos on how I can go about actually calling my Web API from a blazor app for example?

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

    Hi Patrick, thank you for the great video and for your effort. I have a question - why do we need to install SQL related packages in the from-end applications? If I create an another class library for data project then I still have to reference the data layer project in the front-end project in order to register DBContext class with the dependency services. Is there a better way of doing this?

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

    thanks bro!

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

    Wouldn't ICollection be faster than List?

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

    I don't believe the ER Model is a clear structure, you add a user and userId as a data type to characters class, which is not a good way to manage the relationship between Users & Characters

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

    Thank a lot 🎉🎉🎉

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

    Can two project with different models point to a same database??
    I want user app and admin app independently but with same database

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

    Thank you!!!

  • @sobrelaroca2701
    @sobrelaroca2701 2 ปีที่แล้ว

    Hi, I want to make a character update. But when I add or update a character attaching the relational objects to it (that already exists on database), the savechanges method attempts to create them into database, I don't want to create just to assign existing skills to character.

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

    Thank you I learned alot

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

      Glad I could help! 😊

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

    Thank you

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

      Most welcome! 😊

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

    Hi and thanks for nice videos!
    Is it possible to debug these autogenerated code within entitity framweworks?

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

    .NET 6 & Authentification

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

    Also, get ready for a new energy at 58:28 :D

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

    what does the return type Task, IActionResult and ActionResult do?

  • @wahyuaryapambudi8054
    @wahyuaryapambudi8054 2 ปีที่แล้ว

    Mantap mang

  • @mannamramakrishna4847
    @mannamramakrishna4847 2 ปีที่แล้ว

    Hii Sir, A Small Doubt, When to use [JsonIgnore]. And in which Class file we will use [JsonIgnore]

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

    setting [JsonIgnore] doesnt really fix, what will happen when an analytics team wants to get the Skills and the characters that are using them?

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

      I'm also running into this problem right now. I want both sides of the relationship to be visible via the API, with the relationship optionally eager loaded through a "fields"/"include" query parameter. How would one resolve this?

  • @Cursix
    @Cursix 2 ปีที่แล้ว

    I have a question if u put [key] on the models does it then not work?

  • @ahmadrio
    @ahmadrio 2 ปีที่แล้ว

    terimakasih

  • @2005bgva
    @2005bgva 2 ปีที่แล้ว

    Patrick thanks for this video. Could you please activate subtitles?

  • @HiTab_Software
    @HiTab_Software 2 ปีที่แล้ว

    Hi Everyone, I had a project in which I had to use the JsonIgnore Attribute, but for data binding I had the problem that the table related could not be accessed. The solution I found was creating an object using Select in you controller query. For example:
    ```_context.Weapon
    .Select(w = new
    {
    w.Id,
    w.name,
    Character = w.
    Character
    .Select(c = new
    {
    c.Id,
    etc etc
    }).ToList()
    }).ToListAsync(); ```

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

    subscribed to your newsletter and when i press the confirm button on the mail it redirects me to a 404 page. Are you aware of that issue?

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

      Thanks a lot for subscribing and for the info, Nick! I hope that's fixed with my latest landing page for the newsletter.

  • @CentauriDK
    @CentauriDK 2 ปีที่แล้ว

    Hi loved your video on Relationships.
    I found your video on the search for the exact problem you also ran into with creating a new record with the same class. You mention there should be another solution where you don’t have to create a new class CreateCharacterDto.
    Have you found a solution for that so that the same class can be used?
    Because I would really like to keep my code as clean and simple as possible.

    • @anisharavind6400
      @anisharavind6400 2 ปีที่แล้ว

      The users property in the characters class was non nullable.. Just make the property nullable..
      public class Character
      {
      public int Id { get; set; }
      public string Name { get; set; }
      public string RpgClass { get; set; } = "Knight";
      public User? User { get; set; }
      public int? UserId { get; set; }
      }
      This way u will be able to save a character without needing to specify a user. But I believe u should use separate classes and not entities as arguments. so better to create DTOs