草庐IT

FuncConvert

全部标签

c# - 从 C# 传递函数作为参数调用 F# 函数

我有以下F#函数letFetchloggerid=logger"string1""string2"//searchadatabasewiththeidandreturnaresult在我的C#类中,我想调用模拟logger函数的FetchF#函数。所以我有以下C#函数作为模拟程序。voidPrint(stringx,stringy){//donothing}我正在尝试使用以下代码从C#类调用F#函数。var_logger=FuncConvert.ToFSharpFunc(Print);var_result=Fetch(logger,3);FuncConvert.ToFSharpFunc