Skip to content

Instantly share code, notes, and snippets.

@erdtsieck
Created September 19, 2014 08:59
Show Gist options
  • Save erdtsieck/9ae9846aa119533f93af to your computer and use it in GitHub Desktop.
Save erdtsieck/9ae9846aa119533f93af to your computer and use it in GitHub Desktop.
public class DefaultController: Controller{
//de webpagina
public async Task<ActionResult> Index(){
var taak1 = Taak1();
var taak2 = Taak2();
//Eerst afwachten, heel belangrijk!!! taak1 en taak2 worden teglijk uitgevoerd
await Task.WhenAll(taak1, taak2);
var result1 = taak1.Result;
var result2 = taak2.Result;
//doe iets met je results.
return View();
}
}
@erdtsieck
Copy link
Author

Waarbij Taak1() en Taak2() een Task<T> returnen

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