Convert Action to Action<object>

前端 未结 4 869
感动是毒
感动是毒 2020-12-11 14:19

I am stuck.

How do I convert the Action to an Action in C#?

Regards Magnus

4条回答
  •  旧时难觅i
    2020-12-11 15:00

    Not sure what you mean by converting... Action is the generic declaration of an action delegate... if you want an action delegate that works on 'object' you would do something like:

    var myAction = new Action(obj=> ... );
    
        

    提交回复
    热议问题