Bits.Tests.Delegates.AnonymousAndLambda C# (CSharp) Method

AnonymousAndLambda() private method

private AnonymousAndLambda ( ) : void
return void
        public void AnonymousAndLambda()
        {
            // this symbol '=>' is called the lambda operator, when reading code you can use the words 'goes to'
            // when you see this symbol.
            // var myMethod = () => Debug.WriteLine();
            // "my method is a parameterless method that goes to debug write line"

            Action<int> beforeLambda = delegate(int p) { Debug.WriteLine("Your passed {0}", p); };
            Action<int> withLambda = param => Debug.WriteLine("bla bla");

            Func<string> lambdaNoPars = () => "this is auto return value";

            Func<int, int, string> complexMethod = (x, y) =>
                {
                    string result = String.Format("{0} X {1} = {2}", x, y, x*y);
                    return result;
                };
        }