От: | yenik | ||
Дата: | 08.12.19 12:17 | ||
Оценка: | 2 (1) |
Local functions automatically capture the context of the enclosing scope to make any variables from the containing method available inside them. This feature was added in C# 7.0, and in C# 8, you can declare a local function as static by adding the static modifier. By adding this, you ensure the local function doesn’t reference any variables from the enclosing scope.