ASP.NET Core Web API .NET 6 2022 - 3. One-To-Many Relationships

  Рет қаралды 98,516

Teddy Smith

Teddy Smith

Күн бұрын

Пікірлер
@旷野中的小草
@旷野中的小草 Жыл бұрын
Truly grateful for the selfless sharing by the author, who is truly a great disseminator of technology. Thank you.
@TeddySmithDev
@TeddySmithDev Жыл бұрын
No problem. Thank you for watching!
@dq9342
@dq9342 Жыл бұрын
Thanks again! Finished your C# course and progressing in this!
@leafmagi2796
@leafmagi2796 2 жыл бұрын
love you Teddy! Last week i simply just searched keyword like java and you bring me to the new world. I have a similar background as you and i get really confused how can i break into the industry. After that i watch every your video, starting to learn C#. This video explaination is amazing because you can visual the complicated relationship and tell in a smooth way. So i cannot just watch the video and go away. You re really crazy man. it seems that you make video every day and burning yourself. Please take a rest man! you work really really hard! and this video is really good, escpecially the parts of key and relationship. i will keep going and follow your track :D i really appreciate you!!!
@TeddySmithDev
@TeddySmithDev 2 жыл бұрын
no joke I read this comment and just said “this guy is right. I ain’t don’t shit today” %100 srs lmao
@mbulelo-damba
@mbulelo-damba 2 жыл бұрын
Hi Teddy, thanks for this series of tutorials. I enjoyed and actually learnt a lot regarding your UML Diagram. I'm following this til the end.
@justadude8716
@justadude8716 Жыл бұрын
Boosting your videos for the algorithm, great video on relational databases.
@muttBunch
@muttBunch Жыл бұрын
As I'm doing this in my current app, I find myself saying it just like Teddy and moving the mouse, "One...to many...one...to many" lol :D Thanks Teddy.
@dzaninkudus3019
@dzaninkudus3019 Жыл бұрын
Started my journey as a self taught back-end dev recently and i can say the videos up to now are amazing.I am sure to stick around until the end.Mind me asking also if there is a chance that you do a short tutorial about Git
@disapqointed
@disapqointed 6 ай бұрын
How it's going ?
@HoopersHighlights-l3z
@HoopersHighlights-l3z 11 ай бұрын
Dude after watching sooo many tutorials from developers from India.... listening yours is sooo much cool lol
@yankov2206
@yankov2206 6 ай бұрын
Bro really helpfully videos Im trying switch from node js to c# Im frontend react dev But find job on fullstack. My firrst app on node js was todo. I'm was so impressed such simple app is can't find examples on KZbin Your cours is a masterpiece! Thanks for sharing. Its really helpful! Best regards!
@yankov2206
@yankov2206 6 ай бұрын
btw, where you deployed this app or your own web site? what platform is (i see its not a git or vercel, heroku?)
@Kaivalyamani
@Kaivalyamani 7 ай бұрын
I guess you are telling it all reverse. For those having confusion in this one-many or many-one relationship, look at some ER daigram examples. Pokemon table is the 'one' endpoint and Review table is the 'many' endpoint i.e. one Pokemon can have many review. We have ICollection in Pokemon table because One Pokemon can have multiple reviews and thats why we need something to hold list of reviews. We have simple Pokemon field in the Review table because one review contains details about a single Pokemon
@HussainAl-ahmdi
@HussainAl-ahmdi 11 ай бұрын
Thanks man I understood how to write code for relationships after 2days from searching .
@sdscode
@sdscode Жыл бұрын
Definitively agree on the Django Models comment, kinda interesting sometimes XD
@kuhlekt1v
@kuhlekt1v 2 жыл бұрын
Hey Teddy great video overall, but I would argue against your comments around 8:40 where you state that an ICollection is not editable. IEnumerable is not editable, but ICollection is derived from IEnumerable and includes additional functionality to add/remove/update elements in the list. Similarly, you state that ICollection will ALWAYS be used in one-to-many relationships for the many.. IEnumerable is also another very popular way to handle one-to-many. Maybe I'm misguiding, so I would love to hear your take on this.
@TeddySmithDev
@TeddySmithDev 2 жыл бұрын
Thank you for clarifying this. I think I may have been thinking one thing but said another because that makes zero sense. You are indeed correct tho and thank you for commenting!!!!
@andreibudaes3966
@andreibudaes3966 Жыл бұрын
Bro...I love your tutorials but 10:01 ...not true...I've worked in Flask with SQLAlchemy and the Model definitions are bliss and relationships are easy one-liners. Muuuuuch easier and cleaner in Python...The only reason I'm learning C# now is because my company builds their API's in C# so I need to up my C# game but would be way less code with Python, Flask and SQLAlchemy...can't comment on Django as I've not used it but if it supports SQLAlchemy I assume it would be similar. Here's an example. I have a CoinInfo model in which the symbol_id is a Foreign Key for a table called TickerData. I don't have to have 3 locations to define this connection (like in the many-to-many you need to add some lines in the Primary table, the Ref table and the DataContext class). ```python class CoinInfo(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) symbol_id = db.Column(db.Integer, db.ForeignKey('ticker_data.id')) insert_timestamp = db.Column(db.DateTime, default=datetime.utcnow()) update_timestamp = db.Column(db.DateTime, default=datetime.utcnow(), onupdate=datetime.utcnow()) ticker_data = db.relationship('TickerData', backref='coin_info', uselist=False) ```
@joaquincataldo8046
@joaquincataldo8046 Жыл бұрын
Hi Teddy, thank you for all this content. I just got one quick question. According to what I saw in Many To Many rels video, we don't need to specify, for example, the country_id field in Owner's model? Because you are referencing the relationship itself but we are not specifying the country_id field.
@xlizer1_18
@xlizer1_18 29 күн бұрын
you defo deserve a like and sub
@chadgregory9037
@chadgregory9037 2 жыл бұрын
1:1 basically like having a complex datatype as an entity field.
@RalphWeber-z2x
@RalphWeber-z2x Жыл бұрын
Thanks, great video
@chadgregory9037
@chadgregory9037 2 жыл бұрын
So is this the method for doing specifically Web API models... or is this just one method of doing models for both Web API and MVC... I'm a bit of a "toil on things" person rather than "its good enough to keep building what im doing" ... lol... so I got hung up a little on models... and I've come to find out there are multiple methods, convention based relations and fluent api based relations. I like getting my head around everything, and then when I get building again things happen fast
@chadgregory9037
@chadgregory9037 2 жыл бұрын
The many to many is what I still get pretzel brained about, as sad as it is to admit lol. I'll blame other life things at the moment though lol. One to many is easy, as in one blog entry can have many comments. Many to many is where things get stupid lol. Like, many to many is easy in the context of say having AppUsers to follow each other.... AppUser can have many followers, and they can also follow many people. The relation is between the AppUser entity and itself, if you will.... But say, Blogs and AppUsers where AppUser can follow blogs and where a blog can have many followers.... I guess it's the same shit, just a join table entity and the 2 foreign keys, just from two separate classes instead of the same class. I need to learn to not make things so fucking complicated lol
@kuhlekt1v
@kuhlekt1v 2 жыл бұрын
@@chadgregory9037 Many-to-many can be extremely difficult to wrap your head around, and there are sadly not very many good tutorials out there about how to efficiently implement a many to many relationship. As you begin to look into many to many relationships you will have to also consider the cascading effects of CRUD operations on your database, as your models now implement primary/foreign key relationships in multiple places.
@kunying4037
@kunying4037 2 жыл бұрын
thank you so much sir
@cryptoeric24
@cryptoeric24 Жыл бұрын
Would you add the ? after string for nullable fields?? i.e. public string? Name { get; set; }
@cathe9370
@cathe9370 Жыл бұрын
Buen curso!
@MrLaCritico
@MrLaCritico Жыл бұрын
Thank you x3
@random-bd3xg
@random-bd3xg Жыл бұрын
Hi can you make like a project with dal bal layer with like calling stored procedure also using azure please 😢😢😢😢😢😢
@RalphWeber-z2x
@RalphWeber-z2x Жыл бұрын
foreign key - relation to other tables
@RAMATW2023
@RAMATW2023 7 ай бұрын
I am confused, Upon setting public Country Country { get; set; } ( @9:14 ) I get Country is a namespace but used like a type.
@TeddySmithDev
@TeddySmithDev 7 ай бұрын
You probably have a misplaced/misspelled keyword in Country
@RAMATW2023
@RAMATW2023 7 ай бұрын
@@TeddySmithDev I didnt, I tried to change it up and missed things up. The namespace ending had the same name "Country" as the class name. Visual studio would only let me select the namespace. I changed the class "Country" to "Country1" to test, I was then able to use the "Country1" class.
@meltygear5955
@meltygear5955 7 ай бұрын
@@RAMATW2023 I'm following the same video and I don't get that problem. Are you sure you have all required files in the Models folder and your namespace at the top of every model file is "namespace PokemonReviewApp.Models"?
@Synergy_World
@Synergy_World 2 жыл бұрын
South Africa is here
@caseyspaulding
@caseyspaulding Жыл бұрын
Thanks!
@SweepAndZone
@SweepAndZone 10 ай бұрын
You're amazing. Glad I found you
@Hollowendz
@Hollowendz 2 жыл бұрын
Hey teddy drop the uml Link
@EdgarDanielLópezCarbajal
@EdgarDanielLópezCarbajal 6 ай бұрын
Can I use Mysql instead sql server for doin this?
@kvelez
@kvelez 6 ай бұрын
Cool
@Cursix
@Cursix 2 жыл бұрын
Teddy i have a question why is some dev using [forgnkey] and some people dont isnt it better to use that?
@TeddySmithDev
@TeddySmithDev 2 жыл бұрын
Either way is fine. Entity framework has abstracted away the need to have foreign key today, but the way I have is more "explicit". Thanks for commenting!
@Cursix
@Cursix 2 жыл бұрын
@@TeddySmithDev thank you for explaining
@John_Noble
@John_Noble 10 ай бұрын
What company do you work for? If it is not a secret
@TeddySmithDev
@TeddySmithDev 10 ай бұрын
You can see all past companies I’ve worked for on LinkedIn but I keep current secret because people are crazy.
@garshafatemianaraki9041
@garshafatemianaraki9041 Ай бұрын
Gg
@nesa6582
@nesa6582 2 жыл бұрын
what to do with enums when making models?
@TeddySmithDev
@TeddySmithDev 2 жыл бұрын
In my MVC course I have an example of enums in models.
@KALYANMITTINTI
@KALYANMITTINTI 8 ай бұрын
Teddy can you give all database code , Thanks In Advance
@TeddySmithDev
@TeddySmithDev 8 ай бұрын
Sry database was deleted way back
@KALYANMITTINTI
@KALYANMITTINTI 8 ай бұрын
​@@TeddySmithDev I'm perplexed by the database and struck by the database. Please help me to provide the dbcode.
@gaikwadpremkumar5830
@gaikwadpremkumar5830 3 ай бұрын
8:00
@oPunkko
@oPunkko Жыл бұрын
I don't like the fact that you used Pokemon, use a real world example that many people will understand. What's a review?
@TeddySmithDev
@TeddySmithDev Жыл бұрын
Replace the words with something that is relevant to your life and learn better 👍
@DilipKumarS-w3c
@DilipKumarS-w3c 11 ай бұрын
you need to improve your teaching skills
ASP.NET Core Web API .NET 6 2022 - 3. Many-To-Many Relationships
12:03
Perfect Pitch Challenge? Easy! 🎤😎| Free Fire Official
00:13
Garena Free Fire Global
Рет қаралды 61 МЛН
This dad wins Halloween! 🎃💀
01:00
Justin Flom
Рет қаралды 60 МЛН
Friends make memories together part 2  | Trà Đặng #short #bestfriend #bff #tiktok
00:18
Getting Started with Entity Framework Core in .NET
26:51
Nick Chapsas
Рет қаралды 24 М.
Brutally honest advice for new .NET Web Developers
7:19
Ed Andersen
Рет қаралды 239 М.
ASP.NET Core Web API .NET 6 2022 - 4. Installing Entity Framework
26:44
ASP.NET Core Crash Course - C# App in One Hour
1:00:44
freeCodeCamp.org
Рет қаралды 1,6 МЛН
[Arabic] Entity Framework Core - 25 One To Many Relationship - Part 1
13:29
DevCreed | محمد الهلالي
Рет қаралды 14 М.
Perfect Pitch Challenge? Easy! 🎤😎| Free Fire Official
00:13
Garena Free Fire Global
Рет қаралды 61 МЛН