C# function within function (Local functions) Local functions – C# Programming Guide | Microsoft Docs As of C#7 (I had no idea!)