Ejemplo n.º 1
0
        public ActionResult Index()
        {
            var viewModel = _healthService.CreateModel();

            if (Request.AcceptTypes.Contains("application/json"))
            {
                return(Content(JsonConvert.SerializeObject(viewModel)));
            }

            return(View(viewModel));
        }
Ejemplo n.º 2
0
        // GET: Health
        public ActionResult Start()
        {
            var viewModel = _healthService.CreateModel();

            Assembly assembly        = Assembly.GetExecutingAssembly();
            var      version         = assembly.GetName().Version.ToString();
            var      fileVersionInfo = FileVersionInfo.GetVersionInfo(assembly.Location);

            viewModel.BuildId         = _healthSettings.BuildId;
            viewModel.Version         = fileVersionInfo.ProductVersion;
            viewModel.AssemblyVersion = version;

            if (Request.AcceptTypes.Contains("application/json"))
            {
                return(Content(JsonConvert.SerializeObject(viewModel)));
            }

            return(View(viewModel));
        }