File tree Expand file tree Collapse file tree
src/Web/WebMVC/ViewComponents Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,22 +19,7 @@ public async Task<IViewComponentResult> InvokeAsync(ApplicationUser user)
1919 var item = await GetItemsAsync ( user ) ;
2020 return View ( item ) ;
2121 }
22-
23- // Notice that this method is a Task
24- // returning asynchronous method. But, it does not
25- // have the 'async' modifier, and does not contain
26- // any 'await statements.
27- // The only asynchronous call is the last (or only)
28- // statement of the method. In those instances,
29- // a Task returning method that does not use the
30- // async modifier is preferred. The compiler generates
31- // synchronous code for this method, but returns the
32- // task from the underlying asynchronous method. The
33- // generated code does not contain the state machine
34- // generated for asynchronous methods.
35- // Contrast that with the method above, which calls
36- // and awaits an asynchronous method, and then processes
37- // it further.
22+
3823 private Task < Basket > GetItemsAsync ( ApplicationUser user ) => _cartSvc . GetBasket ( user ) ;
3924 }
4025}
You can’t perform that action at this time.
0 commit comments