Skip to content

Instantly share code, notes, and snippets.

@khalidabuhakmeh
Created March 4, 2014 19:49
Show Gist options
  • Select an option

  • Save khalidabuhakmeh/9354178 to your computer and use it in GitHub Desktop.

Select an option

Save khalidabuhakmeh/9354178 to your computer and use it in GitHub Desktop.
public ActionResult Index() {
return ProgressFlushResult(x => {
x.PartialView("First");
x.PartialView("Second");
x.PartialView("Third");
});
}
@nikmd23
Copy link

nikmd23 commented Mar 4, 2014

But for my money, yield return is still the most elegant way to do this.

@khalidabuhakmeh
Copy link
Author

You essentially want to create a "Workflow", which at the end of each state/node you want to flush. The yield return might be confusing to devs who might be familiar with that construct as it pertains to an "enumerable" thing.

I personally would prefer a more explicit implementation to something like this so it sticks out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment