public async Task <ActionResult <List <Company> > > GetCompanies() { (bool success, List <Company> output) = await _webSiteServices.GetCompanies(); if (success) { return(output); } else { return(StatusCode(500, "Internal server error")); } }
public async Task <IActionResult> GetCompanies() { (bool success, List <Company> output) = await _webSiteServices.GetCompanies(); if (success) { return(View(output)); } else { var NotFoundViewModel = new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }; return(View("Error", NotFoundViewModel)); } }