コード例 #1
0
        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"));
            }
        }
コード例 #2
0
        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));
            }
        }