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.
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!
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 :)
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 :)
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.
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.
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!
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.
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?
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
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...
Год назад
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.
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
@ 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.
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?
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
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.
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
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?
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.
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.
🚀 Join the .NET Web Academy with a 30% discount - closing soon!
👉 www.dotnetwebacademy.com/courses/academy?coupon=dnwas23yt
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.
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!
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 :)
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 :)
I gave it a try to "refresh concepts". I learned a lot of things. Amazing, Patrick.
Thanks for your feedback! Glad I could help.😊
Another fantastic video and lesson!!! You are a great educator and creator! Thank you so much for this.
Glad you like it. Thank you so much for your kind words! ❤️
Pretty straightforward like usual. Thank you, Patrick!
Glad you liked it! Thanks a lot for your feedback!
I really needed to understand and enhance my skills on EF CORE database mappings. Thanks to you it was made possible❤⭐️⭐️⭐️⭐️⭐️
I see TLOUS reference I give a like and subscribe.... nice tutorials by the other hand
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.
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! 😄
Thanks for giving it free!!!!
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.
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!
thank you alot, 2:57 about sql , i prefer to use a docker image/container
You help me a lot, thx man, i really appreciate your content. Love from Brasil
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.
THis helped me Alot getting started, Thank you so much!
Well explained. Thanks man!
Glad I could help! Thanks a lot for your feedback! 😊
Very nice explained topic. Thank you Patrick for your work 💯
pls again, Really Good tutorial
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?
Very helpful and easy to understand
It would be nice to see how do you deal with for many-to-many relationship update
Love the The Last of Us example😊
Thanks! ❤
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
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...
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.
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
@ 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.
Thank you so much! It helps
Glad it helped!
you don't really need to install ef core package since sql server package internally depends on that i feel 🤔
Amazing Patric ❤
Would you please make video on Ef Core Fluent API with relationship and referential integrity?
very lest resource on that.
Hi Patrick,
Excellent tutorial I have question Do you have in udemy course about Net Maui blazor app?
Thank you! Not yet.
thank you so much 😊
How do I add something from "the other side"? If I want to create a weapon, how do I do that?
Thanks for another greate video!
I see, you love TLOU ;-) Than you for this cool and interesting video :-)
Absolutely! 😁 Thank you for your feedback!
Thank you
Nice
can you explain why your rows are duplicated? Thank you
[16:38] There was no migrations.design file created. Which version of EF is being used here ?
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?
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
Hi, it would be cool if you created a lesson on MAUI. How to create an extensible ProgressBar
true
Do you have a cource in udemy about blazor? too
Here you go: ruclips.net/video/d8LObmppBdw/видео.html
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.
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
thanks dooood
🔥🔥🔥🔥
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?
how character : weapon is 1:M?
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.
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.
Do you know a RUclips tuto on how creating or improving a TSQL request using ChatGPT ? Thanks.
this doesnt work with IdentityDbContext :/
Migration is not working on my end
Great job. What about many to one?
surely i'm not the only one that thought of American schools in the one to many examples 😂
Plzz add put request 🙏 also
It doesn't work, zero value of this tutorial...
Please explain?
do u have discord sir parick god?