예제 #1
0
        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"));
            }
        }
예제 #2
0
        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));
            }
        }