I have watched a few videos on youtube by Les Jackson, on how to create a .net core api. Les uses this approach for a method in his controller
public ActionResult<IEnumerable<Command>> GetAllCommands()
{
var commandItems = _repository.GetAppCommands();
return Ok(commandItems);
}
However I have just read an article in a book that uses this approach
public async Task<ActionResult<IEnumerable<Data.CityDataClass>>> GetCities()
{
return await _repository.GetCities();
}
From my thinking is the second method an overkill using the "async" declaration? The first method wont return anything until it has the results anyway.
Thanks