Referencing Asynchronous F# datatype from C#

Viewed 1590

I created a F# library that returns this datatype

FSharpAsync<IEnumerable<Tupel<DateTime,string>>>

How do I access the FSharpAsync type so I can enumerate through the tuple from C# and print out the content?

4 Answers

Reference FSharp.Core.dll, then:

FSharpAsync<IEnumerable<Tupel<DateTime,string>>> async = ...
IEnumerable<Tuple<DateTime, string>> result = FSharpAsync.RunSynchronously(async, timeout: FSharpOption<int>.None, cancellationToken: FSharpOption<CancellationToken>.None);

FSharpAsync is in the Microsoft.FSharp.Control namespace.

FSharpOption is in the Microsoft.FSharp.Core namespace.

Related