Below is the code snippet:
public async Task<ActionResult> GetProduct(int id)
{
/*
---- some main thread logic...
*/
Task.Run(() => {
/*
---- some background thread logic...
*/
});
return View();
}
In the above code can I call Task.Run() logic without the use of async keyword in the action method? Is it mandatory to use async keyword with Task.Run()?
Please help me to get this clear.