C#C
C#4y ago
surwren

Assigning Lambda to Delegate (PurposesReason)

Based on my (possibly incorrect) understanding, delegates are the variables to which lambda expressions are assigned.

https://stackoverflow.com/a/73819

Also based on my understanding (possibly incorrect), assigning a lambda to a delegate in this way makes it possible to pass said delegate/lambda expression into another method as an input parameter.

My question is, what are the advantages of passing lambda logic into other method with delegates?

Is it solely to promote reusability of code?

Or are there other advantages to it?
Stack Overflow
I get asked this question a lot and I thought I'd solicit some input on how to best describe the difference.
Was this page helpful?