CSharp examples for Custom Type:Local Method
Local Method Variable Capture
using System;//from www. jav a2 s . c o m using System.ComponentModel; class LocalMethodVariableCapture1 { static void Main() { int i = 0; AddToI(5); AddToI(10); Console.WriteLine(i); void AddToI(int amount) => i += amount; } }