First time using delegates/lambda expressions
Hi, I've watched countless videos on delegates and lambda expressions but I can't really seem to get my head around them. I'm currently playing around with them and I'm wondering why is this second testDelegate not throwing an error without defining it's type as a delegate? The only difference is that the second one uses a lambda expression to assign it.
If someone could give me a little explanation on why this is, that'd be great. I sort of understand how delegates work - they point to a function and this can be changed/added to, so that it runs a different function or more than 1 function each time it is called. Lambda expressions just confuse me however, all I've got from these videos is that it is referred to as a "go to" expression and can be used in LINQ functions like .Where and .OrderBy to sort lists and such
If someone could give me a little explanation on why this is, that'd be great. I sort of understand how delegates work - they point to a function and this can be changed/added to, so that it runs a different function or more than 1 function each time it is called. Lambda expressions just confuse me however, all I've got from these videos is that it is referred to as a "go to" expression and can be used in LINQ functions like .Where and .OrderBy to sort lists and such
