Action匿名委托示例

class Program
    {
        static void Main(string[] args)
        {
            string mid = ",mid";
            Action<string> anonDel = delegate (string param)
            {
                param += mid;
                param += " and this.";
                Console.WriteLine(param);
            };

            anonDel += delegate (string t)
            {
                Console.WriteLine(t + System.Guid.NewGuid().ToString());
            };

            anonDel("www.webczw.com");

            Console.ReadKey();
        }
    }
原文地址:https://www.cnblogs.com/webczw/p/4782408.html