Tags: , , ,

C#’s support for closures includes lambdas ((a, b) => a+b) and delegates (delegate(int a, int b){return a+b;}). They’re extremely handy tools that many developers use on a daily basis. For example, it’s really convenient when using List.Find to pass in a lambda like item => item.Id == IdToFind. They also make great callbacks for asynchronous operations. However you’re using them, understanding how they work behind the scenes will help you understand how they behave and give you insight when optimizing your code. Today’s article delves into the topic to gain just this understanding, so read on to learn some more about closures!

Read the rest of this article »

No Comments