Skip to content

Tag: anonymous methods

Anonymous Methods C#

Last time we talked about Delegates, now we’ll look into the concept of anonymous methods that truly shines with the use of delegates. The Delegate ‘Clutter’ In order to use a Delegate you must do 4 things: Anonymous Methods at work By using anonymous methods, we could change step 3 and assign a method ‘on the fly’ without creating a new one The code can be simplified even more Keep in mind that if you have break/continue statements inside your anonymous method the target should remain inside the code block! If you want more information about the scope of the…

Leave a Comment