public IActionResult ViewPing(Guid linkId) { string ip = Request.HttpContext.Connection.RemoteIpAddress.MapToIPv4().ToString(); string userAgent = Request.Headers["User-Agent"].ToString(); if (!_pingService.RegisterAction(linkId, ip, userAgent, "view")) { return(StatusCode(500)); } var vm = _pingService.GetPingData(linkId); if (vm == null) { return(NotFound()); } return(View(vm)); }