I have the following interface method:
Task<string[]> GetBlobsFromContainer(string containerName);
and its implementation in C #:
var container = await _containerClient.GetContainer(containerName); var tasks = container.ListBlobs() .Cast<CloudBlockBlob>() .Select(b => b.DownloadTextAsync()); return await Task.WhenAll(tasks);
When I try to rewrite it in F #:
member this.GetBlobsFromContainer(containerName : string) : Task<string[]> = let task = async { let! container = containerClient.GetContainer(containerName) |> Async.AwaitTask return container.ListBlobs() |> Seq.cast<CloudBlockBlob> |> Seq.map (fun b -> b.DownloadTextAsync()) |> ?? } task |> ??
I am stuck in the last lines.
How to return to Task<string[]> from F #?
f # c # -to-f # task-parallel-library async-await
abatishchev
source share