How to convert F# function to non-generic System.Action?

风流意气都作罢 提交于 2019-12-23 15:19:47

问题


Just as in title. I have an existing C# library, and I must access it using F# interop. One of the methods takes a non-generic System.Action delegate as a parameter. How can I convert F# function (i.e. unit->unit) to that delegate?

While trying to use direct cast, a following error occurs:

Multiple types exist called 'Action', taking different numbers of generic parameters. 
Provide a type instantiation to disambiguate the type resolution, e.g. 'Action<_,_,_,_,_,_,_,_,_>'.

来源:https://stackoverflow.com/questions/27666242/how-to-convert-f-function-to-non-generic-system-action

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!