Please Note: This is continuation of the question posted earlier but the solution of interest is of a different situation.
I am trying to make multiple calls to the methods that each return IObservable but the values being returned back in the SelectMany statement is a Task and hence the following Subscribe statement does not compile.
This is the code snippet
var myWorkList = new List<MyWork>
{
new MyWork(),// MyWork.Execute(data) returns IObservable
new MyWork()
}.ToObservable();
var results =
myService
.GetData(accountId)
.SelectMany(data => myWorkList.ForEachAsync(r => r.Execute(data))
.Subscribe(result =>
{
Console.WriteLine($"Result Id: {result.Id}");
Console.WriteLine($"Result Status: {result.Pass}");
});