是List <T>,其中T是匿名代表吗?

t3r*_*rse 6 c# generics lambda delegates

是否可以在C#中创建匿名委托列表?这是我想写的代码,但它不编译:

Action<int> method;
List<method> operations = new List<method>();
Run Code Online (Sandbox Code Playgroud)

Roh*_*est 16

例如,你可以写这个

        Action<int> method = j => j++;
        List<Action<int>> operations = new List<Action<int>>();

        operations.Add(method);
        operations.Add(i => i++);
Run Code Online (Sandbox Code Playgroud)