Why use `await AbcAsync()` instead of `Abc()`
I'm going through the tutorial in this page: https://learn.microsoft.com/en-us/aspnet/core/tutorials/first-mvc-app/controller-methods-views?view=aspnetcore-9.0
I don't understand this bit of generated code inside an async controller method:
why call
I assume that this is because the async method will only temporarily free the thread to do other work once it hits an
I don't understand this bit of generated code inside an async controller method:
why call
_context.SaveChangesAsync() and then immediately await it, instead of the synchronous version _context.SaveChanges() (which does exist)? I assume that this is because the async method will only temporarily free the thread to do other work once it hits an
await, but that doesn't make sense, because that's the whole point of an async method (whether it uses await inside its body or not).