Delegates & Events in C# Explained for Beginners (a little of Event-Driven Development)🔔

  Рет қаралды 36,150

Patrick God

Patrick God

Күн бұрын

Пікірлер: 62
@PatrickGod
@PatrickGod Жыл бұрын
Hey friends! 👋 Patrick here. I wanted to add a quick note to this tutorial. I missed mentioning something important: the built-in generic delegates Func and Action. These are really handy for common scenarios - Func is used for methods that return a value, and Action for those that don't return anything. They often simplify the code compared to custom delegates. I'll make sure to cover these in more detail in a future video. Stay tuned, and happy coding! 😊👨‍💻 Patrick
@dhruvsharma9230
@dhruvsharma9230 10 ай бұрын
what sit u explain do u know how explain beginner pig
@charliehager5458
@charliehager5458 Жыл бұрын
You make a very good point that delegates and events are very easy to create and use. Probably under utilized these days. Possibilities for use are endless. Thanks!
@PatrickGod
@PatrickGod Жыл бұрын
Glad I could help! Thanks for your feedback!
@Kla-pn4kt
@Kla-pn4kt Жыл бұрын
as a blazor beginner, your explanation is really helpful. Thanks.
@PatrickGod
@PatrickGod Жыл бұрын
Thanks a lot for your feedback! Glad I could help. 😊
@horizon6309
@horizon6309 Күн бұрын
Thank you for the high quality tutorial Patrick, I finally understand the concepts of delegates and events 🙂
@dasfahrer8187
@dasfahrer8187 Жыл бұрын
I think a much deeper dive is needed for these concepts (why they exist, what problems do they solve, why use them over something simpler and more direct, etc...) as you're getting into more advanced programming and complexity by implementing them. You typically don't use them willy-nilly.
@agusstiinbt
@agusstiinbt Жыл бұрын
Great answer. I also think that delegates and events are only useful in certain situations. In this case in was only useful to learn about them. But not a great example of when you consider using them
@weamhaleemi4984
@weamhaleemi4984 Жыл бұрын
Try learning rabbitMq without them.. it wont work
@ard-janverhage3577
@ard-janverhage3577 Ай бұрын
Thank you very much, this is the first video I found that explains it this simple.
@3k1p5
@3k1p5 Жыл бұрын
I really like your way to describe the principles in clear understandable ways. Keep going it's great, thanks.
@elbadrey
@elbadrey 21 күн бұрын
Much deeper needed, but all of all, thank you
@Ayymoss
@Ayymoss Жыл бұрын
Question; why should we use explicit delegate over Action for example? I think this has the same functionality, but in one line rather than 2?
@PatrickGod
@PatrickGod Жыл бұрын
Good point! In the given example, using Action instead of a custom delegate like AchievementUnlockedHandler would indeed simplify the code. The choice here was mainly to demonstrate how custom delegates work and how they can be used to create events. In practical applications, opting for Action is a great idea for its simplicity and brevity, especially for straightforward cases like this. Custom delegates become more useful when you need more descriptive names or complex method signatures. Thanks for pointing this out!
@Ayymoss
@Ayymoss Жыл бұрын
@@PatrickGod Ah, thank you for clarifying. :)
@vukasin97
@vukasin97 Жыл бұрын
Very nice explanation 👍 Also that bright light in your background gives a nice fresh look to the video
@PatrickGod
@PatrickGod Жыл бұрын
Thank you! Funny you're mentioning the bright light. It was actually just the sun shining through the window and I thought it was too bright. 😅
@philippemaze4562
@philippemaze4562 7 ай бұрын
One of the clearer tuto I follow about event & delegates...Thank you so much Patrick !
@shehan.akalanka
@shehan.akalanka 2 ай бұрын
I tried learning events from so many places but they do not explain the basics like you. Really good tutorial. Hope you could create a video about dive into events and delegates.
@SatyaketuSanjay
@SatyaketuSanjay 6 ай бұрын
I was searching for this easy explaination! Thank you Patrick!!
@fryser007
@fryser007 11 ай бұрын
I'm taking a class on Coursera and the teacher sucks, I have to look up on the youtube some key concepts they explain badly and you sir knock it out of the park. Thank you :)
@anasabubakar4125
@anasabubakar4125 Жыл бұрын
Aren't Func and Action a built-in delegates ? I think they are easier to understand than creating custom delegates
@PatrickGod
@PatrickGod Жыл бұрын
Yes, you're absolutely right! Func and Action are indeed built-in generic delegates provided by .NET. They are often more convenient and easier to understand, especially for common scenarios. Func is used for methods that return a value, while Action is for those that don't. Custom delegates are more about understanding the underlying concept and are useful in certain specialized cases. Great observation! 👍
@shahnawazk
@shahnawazk Жыл бұрын
Very helpful and informative. Thanks and keep it up!
@PatrickGod
@PatrickGod Жыл бұрын
Thank you so much!
@maacpiash
@maacpiash Жыл бұрын
Excellent video. Concise, clear, to the point.
@KatSanok
@KatSanok Жыл бұрын
Patrick you do a great job ! Thanks for another nice explaining video.
@MEGAFOXTERRIER
@MEGAFOXTERRIER Жыл бұрын
Loving these videos! Could you also please make a Blazor Auto Render Mode CRUD Full Course video?
@38911bytefree
@38911bytefree Жыл бұрын
Thanks man, Im a bit rusted on these concepts .. LOL
@PatrickGod
@PatrickGod Жыл бұрын
Anytime! Glad I could help! 😊
@tidianediallo6199
@tidianediallo6199 Жыл бұрын
That's great master Patrick, as a blazor beginer I'm excited? Thank you of lot. The explanations are clear and I hate the next video. also a tutorial on the connection of webApi, signalR and Chatgpt🙂
@salilphadnis4147
@salilphadnis4147 4 ай бұрын
Very well explained. Thank you so much !
@moejahi3d3
@moejahi3d3 Жыл бұрын
Love this! looking forward to the big video. We;re not using .net8 yet but your channel is great to keep up2date or at least in the "know" hehe. Any chance you could make a .net8/identitity server/ Multi tenant video with a central login system shared client but seperate db for each tenant? Been looking into this this week for some idea's hehe.
@brianking8883
@brianking8883 Жыл бұрын
I like this format.
@shobhamahadev118
@shobhamahadev118 10 ай бұрын
i understood properly today abt these concepts.
@PavanTripathi-rj7bd
@PavanTripathi-rj7bd 11 ай бұрын
Thanks for the wonderful explanation!
@gouravkanthed3246
@gouravkanthed3246 11 ай бұрын
Good Explanation..It would be great if u have included delegates with return type also
@griffinovermyer9943
@griffinovermyer9943 3 ай бұрын
Nice video. Quick question: Would it be a bad idea for your function that invokes the event to invoke then set the delegate to null to prevent a memory leak?
@yusufdurmaz4839
@yusufdurmaz4839 8 күн бұрын
can we use that in web?
@douglasemsantos
@douglasemsantos 5 ай бұрын
Great explanation! Thank you!
@FredBCavalheiro
@FredBCavalheiro Жыл бұрын
Excellent explanation. Thanks
@drtowardssuccess500
@drtowardssuccess500 4 ай бұрын
Thank you!
@orterves
@orterves 11 күн бұрын
I prefer to have the class to be coupled with an interface that is injected into the class, that has the callback methods. This forces the object to be instantiated in the data flow with the wiring up already in place. I find that events give the developer too much freedom to create spaghetti data flows, wiring up objects directly, wherever and whenever they want, and causing headaches in finding just where the heck data is going in the app
@NIKOLAOSGYPAS
@NIKOLAOSGYPAS Жыл бұрын
Thanks for the great video Patrick. Is there a way to know if I have subscribed to an event,
@chaikuanhong
@chaikuanhong 7 ай бұрын
good work!
@cjt9150
@cjt9150 Жыл бұрын
Good work. Can you please create a video for custom authentication with cookie/local storage/session storage & without identity
@imanidioli
@imanidioli 9 ай бұрын
First event explanation that didn't confuse me
@lean2009
@lean2009 9 ай бұрын
great lesson!
@kandycan
@kandycan Жыл бұрын
Very good tutorial
@CyprianLibera
@CyprianLibera Жыл бұрын
Very good!
@DontKnowDontCare
@DontKnowDontCare 2 ай бұрын
God is great
@yuhsiangchen7784
@yuhsiangchen7784 9 ай бұрын
Thanks
@srujansanga2689
@srujansanga2689 9 ай бұрын
I subscribe ! Hoohoooooo
@pathumkumara4696
@pathumkumara4696 2 ай бұрын
great
@abdlmhcn
@abdlmhcn Күн бұрын
"And whomsoever Allâh wills to guide, He opens his breast to Islâm; and whomsoever He wills to send astray, He makes his breast closed and constricted, as if he is climbing up to the sky. Thus Allâh puts the wrath on those who believe not." - Quran [6:125] .. - may Allah guide you to Islam 🤍🌺
@Brian-nz6ns
@Brian-nz6ns 8 ай бұрын
Not well explained...
@FilthySnob
@FilthySnob 7 ай бұрын
Messy bullshit
@essentia9
@essentia9 5 ай бұрын
dude I don't know yet what a delegate is and you are throwing into my face async/await. Kind of stupid
C# Events and Delegates Made Simple | Mosh
32:04
Programming with Mosh
Рет қаралды 958 М.
1% vs 100% #beatbox #tiktok
01:10
BeatboxJCOP
Рет қаралды 67 МЛН
C# Events & Delegates
17:21
Tarodev
Рет қаралды 93 М.
Brutally honest advice for new .NET Web Developers
7:19
Ed Andersen
Рет қаралды 316 М.
Event-Driven Architecture: Explained in 7 Minutes!
7:18
Alex Hyett
Рет қаралды 142 М.
C# Events - Creating and Consuming Events in Your Application
1:09:13
Delegates & Events in C# .NET
6:04
Interview Happy
Рет қаралды 65 М.
What are Delegates? (C# Basics, Lambda, Action, Func)
18:39
Code Monkey
Рет қаралды 307 М.
Are events in C# even relevant anymore?
16:19
Nick Chapsas
Рет қаралды 172 М.
Dependency Injection, The Best Pattern
13:16
CodeAesthetic
Рет қаралды 913 М.