private async void VisitorAgentStatistics() { bool cookieVisitorExist = cookieHandler.CheckIfCookieExist("VisitorCookie"); bool cookieDeviceExist = cookieHandler.CheckIfCookieExist("DeviceInfo"); if (cookieVisitorExist || cookieDeviceExist) { return; } cookieHandler.CreateCookie("VisitorCookie", Guid.NewGuid().ToString(), null); var countryName = GetVisitorLocationAsync(Request.HttpContext.Connection.RemoteIpAddress.MapToIPv4().ToString()); var c = cookieHandler.GetClientInfo(); VisitorAgent visitor = new VisitorAgent(); visitor.Browser = c.UA.Family + " " + c.UA.Major; visitor.OperatingSystem = c.OS.Family + " " + c.OS.Major; visitor.Country = countryName.Result; visitor.VisitTime = DateTime.UtcNow.ToLocalTime().ToString("yyyy-MM-dd' 'HH:mm:ss"); await _apiService.CreateUpdateData <VisitorAgent>(visitor); }