I am trying to convert my methods to asynchronous.
I have added async Task<IActionResult> and seems the methods work fine.
However, just it is enough to make them asynchronous? Wouldn't I need an "await" somewhere? but where ?
// CONTROLLER
public async Task<IActionResult> GetProducts()
{
try
{
return Ok(_productServices.GetAllProducts());
}
catch (Exception ex)
{
return StatusCode(500, "");
}
}
// SERVICES
public IEnumerable<ProductModel> GetAllProducts()
{
var products = List<ProductModel>() {
...
}
return products
}
Thank you,