英文:
How can I call a C# function that takes an Action<T> from F#?
问题
我需要从F#调用这个函数,并传递一个BinanceRestOptions
对象?
英文:
I need to call this function, from a C# lib:
public BinanceRestClient(Action<BinanceRestOptions> optionsDelegate)
: this((HttpClient) null, (ILoggerFactory) null, optionsDelegate)
{
}
How can I call it from F# and pass a BinanceRestOptions
object?
答案1
得分: 2
将匿名函数传递给它,例如:
let bc = BinanceRestClient(fun opts -> ())
或者
let bc = BinanceRestClient(fun opts ->
opts.SomeProp <- 1
opts.SomeOtherProp <- "" )
英文:
Pass an anonymous function to it, for example:
let bc = BinanceRestClient(fun opts -> ())
or
let bc = BinanceRestClient(fun opts ->
opts.SomeProp <- 1
opts.SomeOtherProp <- "" )
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论