We have the option to use the original coroutines or using C#5 async/await.
However, taking a class based on IResult and calling AsResult on it to return a Task for async/await doesn't pass it through IoC.BuildUp to inject properties (IWindowManager etc.).
For consistency could we pass it through IoC.BuildUp before execution or is there some other reason for this?
Comments: In standard CM Coroutines the IResult doesn't pass through IoC.BuildUp until it's been yielded. If you use AsTask() then it never goes through this. CM seems to wrap the Result in a new Task and I think that it could be passed through IoC.BuildUp in there. Otherwise, you can't really use Results interchangeably with either method. For instance, I have a ShowDialogResult that needs the IWindowManager injected. At the moment I'd have to pass this in through the constructor from the VM or manually pass the result to IoC.BuildUp before calling 'await' on it.
However, taking a class based on IResult and calling AsResult on it to return a Task for async/await doesn't pass it through IoC.BuildUp to inject properties (IWindowManager etc.).
For consistency could we pass it through IoC.BuildUp before execution or is there some other reason for this?
Comments: In standard CM Coroutines the IResult doesn't pass through IoC.BuildUp until it's been yielded. If you use AsTask() then it never goes through this. CM seems to wrap the Result in a new Task and I think that it could be passed through IoC.BuildUp in there. Otherwise, you can't really use Results interchangeably with either method. For instance, I have a ShowDialogResult that needs the IWindowManager injected. At the moment I'd have to pass this in through the constructor from the VM or manually pass the result to IoC.BuildUp before calling 'await' on it.