In essence, a closure is a block of code that can be executed at a later time, but which maintains the environment in which it was first created - i.e. it can still use the local variables, etc of the method which created it, even after that method has finished executing. The general feature of closures is implemented in C# by anonymous methods and lambda expressions. Here's an example using an anonymous method: using System; class Test { static void Main() { Action action = CreateAction(); action(); action(); } static Action CreateAction() { int counter = 0; return delegate { ...
(Helping you out with C#, ASP.NET, SQL, Microsoft Azure, MVC & Javascript)