© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
32 replies
n

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
image.png
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

(Concept Question) Delegates and Lambda Expressions [Answered]
C#CC# / help
4y ago
Lambda, delegates, events. Help !
C#CC# / help
2y ago
Lambda, delegates, evens. Help !
C#CC# / help
2y ago
❔ Lambda expressions in C#
C#CC# / help
3y ago