I have a method similar to the following in WebAPI - MVC
public IActionResult Post(Model model)
{
ALongRunningMethod();
return Ok();
}
I have two options.
Tasks
but return Ok (200 HTTP Code) immediately
? What if some exception occur in that long running method ?Totally confused. What should I do in this case ?
Starting from .Net 4.5.2, you now have QueueBackgroundWorkItem
to deal with long running operations in ASP.Net.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With