public IActionResult Index([FromServices] ITodoRepository repository, [FromServices] HealthHandler handler) { str = Configuration.GetConnectionString("connectionString"); Test = repository.GetTest(); ViewBag.Latencia = handler.Watch(repository).ElapsedMilliseconds; ViewBag.Server = handler.Handle(str).Server; ViewBag.DataBase = handler.Handle(str).Database; if (Test != null) { ViewBag.Teste = "Servidor Operacional"; } else { ViewBag.Teste = "Servidor Fora do Ar"; } return(View("/wwwroot/index.cshtml")); }