Created
November 1, 2017 08:24
-
-
Save cpoDesign/626a33948cfe27c8609728429545a5d9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public async Task<IHttpActionResult> MethodA() | |
{ | |
var customer = new Customer(); | |
customer.Widgets = await _widgetService.GetAllWidgets(); | |
customer.Foos = await _fooService.GetAllFoos(); | |
return Ok(customer); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public async Task<IHttpActionResult> MethodB() | |
{ | |
var customer = new Customer(); | |
var getAllWidgetsTask = _widgetService.GetAllWidgets(); | |
var getAllFoosTask = _fooService.GetAllFos(); | |
Task.WaitAll(new List[] {getAllWidgetsTask, getAllFoosTask}); | |
customer.Widgets = getAllWidgetsTask.Result; | |
customer.Foos = getAllFoosTask.Result; | |
return Ok(customer); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment