Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How can I call a C# function that takes an Action<T> from F#?

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?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Pass it an anonymous function, for example:

let bc = BinanceRestClient(fun opts -> ())

or

let bc = BinanceRestClient(fun opts ->
    opts.SomeProp <- 1
    opts.SomeOtherProp <- "" )
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading