I have the below code which calls a workflow. I am wondering if I can changed the controller to be asynchronous using the async ctp.
public ActionResult Index()
We can use the TAP pattern for invoking windows workflow as follows - (Details are mentioned in my blog post http://tweetycodingxp.blogspot.com/2013/06/invoke-workflow-wf-using-task-based.html)
public async Task Index(string id)
{
var wfInputArgs = new Dictionary
{
...
};
var wfOutputArgs = await Task>.Factory.StartNew(
() => WorkflowInvoker.Invoke(new MyWorkflow(), wfInputArgs));
var result = wfOutputArgs["Output1"] as IEnumerable;
...
return View(model);
}