Monday, June 23, 2025 14:49

Posts Tagged ‘anonymous method’

Anonymous methods

Saturday, February 1st, 2020

Remember from the lesson lambda expressions that we can declare a method locally, without a name, and use it only in one place, where we declare it. This is an example of a lambda expression:

using System;

namespace HelloWorld
{

    public class Program
    {
        delegate bool SomeDelegate(int _param);

        public static void Main()
        {
            SomeDelegate _delegate = i => i > 5;

            Console.Read();
Read more

Lambda expressions

Sunday, January 12th, 2020

In the previous lesson I was writing that we can further improve our code by using lambda expressions. A lambda expression is a convenient way of defining an anonymous (unnamed) function that can be passed around as a variable or as a parameter to a method call.… Read more