Remove async await issue comments
Thanks for the review!
This commit is contained in:
parent
00491910a2
commit
8c6d880f18
@ -16,19 +16,7 @@ namespace WebMVC.Services.Utilities
|
||||
_client = new HttpClient();
|
||||
_logger = new LoggerFactory().CreateLogger(nameof(HttpApiClientWrapper));
|
||||
}
|
||||
|
||||
// Notice that these (and other methods below) are Task
|
||||
// returning asynchronous methods. But, they do not
|
||||
// have the 'async' modifier, and do not contain
|
||||
// any 'await statements. In each of these methods,
|
||||
// the only asynchronous call is the last (or only)
|
||||
// statement of the method. In those instances,
|
||||
// a Task returning method that does not use the
|
||||
// async modifier is preferred. The compiler generates
|
||||
// synchronous code for this method, but returns the
|
||||
// task from the underlying asynchronous method. The
|
||||
// generated code does not contain the state machine
|
||||
// generated for asynchronous methods.
|
||||
|
||||
public Task<string> GetStringAsync(string uri) =>
|
||||
_client.GetStringAsync(uri);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user