Confused about running async methods in the background
Say I have the following methods, in my ASP.NET 5 Web API:
Say I have the following methods, in my ASP.NET 5 Web API:
On a request on my Web API, I’m saving a image to the disk and also processing it with an external API which usually takes several seconds. This is a high traffic API, thus I would like to design it in the most efficient way. The image comes in Base64 “encoding”, but this is not pertinent. We can think about it as an arbitrary byte array of 150KB in average (so the saving to disk operation should be really fast).
I am having some issues where projectLogDict is not updating the ImageCount . If you look at the code below, I have var drawingCount and var imageCount which I add to the Task.WhenAll.
I am trying to display a string in a web page with delay and the following is what I tried but the page does not show until the delay is expired.
In short, remaining in the HTTP context, I would like the user, after clicking on an order completion button, not to wait for the mails to be sent before being sent back to a “thak you page”.
I cannot return List from webform async method via Postman. It just goes forever.
Am I missing something very tricky here?
I have an async method that evaluates a field.
I want to redirect to an action that says Order is successful, but when the form is submitted, it redirects to the same action /Checkout with error: This page isn't working. This is understandble since the query strings are not present, but this doesn’t matter to me. I want
it to redirect to /OrderComplete instead. The debugger confirmed ModelState is valid and RedirectToAction is hit every time.
I have some concerns using async actions in ASP.NET MVC. When does it improve performance of my apps, and when does it not?