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