コード例 #1
0
        public async Task <ActionResult <Bank> > GetBank(int id)
        {
            (bool success, Bank output) = await _webSiteServices.GetBank(id);

            if (success)
            {
                return(output);
            }
            else
            {
                return(StatusCode(500, "Internal server error"));
            }
        }
コード例 #2
0
        public async Task <ActionResult <Bank> > EditBank(int id)
        {
            (bool success, Bank output) = await _webSiteServices.GetBank(id);

            if (success)
            {
                return(View(output));
            }
            else
            {
                var NotFoundViewModel = new ErrorViewModel {
                    RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier
                };
                return(View("Error", NotFoundViewModel));
            }
        }