New Feature – Local Functions in C# 7.0 – Nishant Rana’s Weblog

Nishant RanaDyn365CE8 years ago55 Views

C# 7.0 adds a new feature called local functions.

Local functions allow us to define function within a function. It can be used to write helper methods that we need to use inside that function’s scope.

Here in the below sample code we have defined one main function (MainFunction) that has one local function(MultiplyBy10LocalFunction) defined inside it. And that local function has one more local function(Add10LocalFunction) defined inside it.

Hope it helps..

Full Article

New Feature – Local Functions in C# 7.0 – Nishant Rana’s Weblog

Blog Syndicated with Nishant Rana’s Permission

0 Votes: 0 Upvotes, 0 Downvotes (0 Points)

Leave a reply

Follow
Sign In/Sign Up Sidebar Search
Loading

Signing-in 3 seconds...

Signing-up 3 seconds...