Correctly awaiting in F# an async C# method with return type of Task<T>
问题 I'd like to be able to consume a C# library from F#. Mostly this has been pretty straightforward. However, if I try to call a function that returns a Task<T> I am not able to get the returned value. So, I have C# method with the following definition: public async Task<TEvent> ReadEventAsync<TEvent>(string streamName, int position) where TEvent: class And I am trying to consume this method from F# as follows: let readEventFromEventStore<'a when 'a : not struct> (eventStore