In the following method I'm getting the warning: This async method lacks 'await' operators and will run synchronously
. Where can I use await
in this mehod? Note: This method is returning a simple static View without interacting with a Database etc.
public class TestViewComponent : ViewComponent
{
public async Task<IViewComponentResult> InvokeAsync()
{
return View();
}
}
return Task.FromResult<IViewComponentResult>(View())
vs. just ignoring the warning? – Hartfield