Beispiel #1
0
        public async Task <IActionResult> Get()
        {
            try
            {
                var result = await _mongoDbContext.ConnectionOk();

                return(Ok(new StatusCheck
                {
                    AppName = "Bowling.Api",
                    Version = Assembly.GetExecutingAssembly().GetName().Version.ToString(),
                    MongoDbWorking = result
                }));
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception happened when checking connection status of mongo: ", e);

                return(StatusCode(500));
            }
        }