# Closures: Lambdas That Remember

A lambda can use the local variables around it. It captures the variable itself, not a copy of its value, and keeps it alive for as long as the lambda lives, which is how a method can hand back a counter that remembers its count.

![Cheat sheet: Closures: Lambdas That Remember](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/a1762f44e12a48329d87a9570c1c45aa.webp)

- Category: C#
- Level: Journeyman
- Tags: Closure (c-sharp), c-sharp, Lambda Expression (c-sharp), Local Variable (c-sharp), Scope (c-sharp)
- Author: Gregor Dzierzon
- Updated: November 17, 2026

Source: https://www.ask-codey.com/cheat-sheets/linq-closures-cheat-sheet
