问题
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