예제 #1
0
        public async Task <IActionResult> GetAsync()
        {
            var results = await WaitAll(new Dictionary <string, Task <bool> >()
            {
                { "database", Succeeds(_databaseRepo.Test()) },
                { "slack", Succeeds(_slackClient.ApiTest(new SlackApiTestRequest())) },
                { "auth", Succeeds(_slackClient.AuthTest(new SlackApiAuthTestRequest())) },
            });

            var success    = results.All(x => x.Value);
            var statusCode = success ? HttpStatusCode.OK : HttpStatusCode.InternalServerError;

            return(base.StatusCode((int)statusCode, results));
        }