How to define an extension method in a scriptcs csx script

前端 未结 3 665
逝去的感伤
逝去的感伤 2021-01-01 16:38

I\'m playing with ScriptCS (which is awesome!) but I couldn\'t figure out how to define an extension method within a .csx script file.

Take this e

3条回答
  •  攒了一身酷
    2021-01-01 17:19

    I feel your pain.

    Actually this is a limitation of Roslyn currently as it wraps everything into a class even if it is another class.

    I've talked to the Roslyn team however and they are going to support extension methods soon.

提交回复
热议问题