Clint
β
Can someone explain Delegates to me like i'm 5?
Just letting you know that I'm available if you want options and alternative ways of going through this, I think it's great you're looking to learn this, but appreciate that a busy chat window isn't always the best forum for it π
322 replies
β
Can someone explain Delegates to me like i'm 5?
Delegates are pointers to a function, it's just a way of passing the location of a function (and its signature) around.
Let's say you have a list of integers and a function that squares integers and you want to end up with a list of squared integers.
Then going further you could expand out to a generic use case:
Which you could then call do to all sorts of things!
And so on so forth.
This is (basically) what LINQ's Select method is doing:
322 replies