public void HandleVisitor(VISITORS visitor) { if (visitor == null) { throw new ArgumentNullException(nameof(visitor)); } // Checks if localhost / already exists // if (visitor.IP == "localhost" || visitor.IP == "::1") return; if (visitor.IP == "localhost" || visitor.IP == "::1") { visitor.IP = GetRandomIpAddress(); } if (_visitorRepository.Exists(visitor.IP)) { return; } visitor = PopulateVisitorInformation(visitor); _visitorRepository.Add(visitor); }