Ejemplo n.º 1
0
 /// <summary>
 /// Logs a hit to the specified URL
 /// </summary>
 /// <param name="urlId">Shortened URL that was hit</param>
 /// <param name="ip">IP the hit came from</param>
 /// <param name="userAgent">User-Agent the hit came from</param>
 /// <param name="referrer">HTTP Referrer the hit came from</param>
 public async Task LogHitAsync(int urlId, string ip, string userAgent, string referrer)
 {
     var hit = CreateHit(urlId, IPAddress.Parse(ip), userAgent, referrer);
     await _urlRepository.AddHitAsync(hit);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Logs a hit to the specified URL
 /// </summary>
 /// <param name="urlId">Shortened URL that was hit</param>
 /// <param name="ip">IP the hit came from</param>
 /// <param name="userAgent">User-Agent the hit came from</param>
 /// <param name="referrer">HTTP Referrer the hit came from</param>
 public async Task LogHitAsync(int urlId, IPAddress ip, string userAgent, string referrer, CancellationToken token = default(CancellationToken))
 {
     var hit = CreateHit(urlId, ip, userAgent, referrer);
     await _urlRepository.AddHitAsync(hit, token);
 }