public StatHttpMessageEntity CreateHttpMessageEntity(string eventId, DateTime dateTime)
        {
            string url    = _httpContextRepository.GetUrl();
            string method = _httpContextRepository.GetHttpMethod();

            string[] userLanguages = _httpContextRepository.GetUserLanguages();

            string action = _tableValueConverter.StringsToKey(url, method);
            string convertedUserLanguages = _tableValueConverter.ArrayToString(userLanguages);

            return(new StatHttpMessageEntity
            {
                Action = action,
                DateTime = dateTime,
                AnonymousId = _authenticator.GetAnonymousId(),
                EventId = eventId,
                HttpMethod = method,
                IsAuthenticated = _authenticator.IsAuthenticated(),
                StatusCode = _httpContextRepository.GetStatusCode(),
                Url = url,
                UrlReferrer = _httpContextRepository.GetUrlReferrer(),
                UserAgent = _httpContextRepository.GetUserAgent(),
                UserHostAddress = _httpContextRepository.GetUserHostAddress(),
                UserHostName = _httpContextRepository.GetUserHostName(),
                UserId = _authenticator.GetUserId(),
                UserLanguages = convertedUserLanguages
            });
        }
Ejemplo n.º 2
0
 public DomainActionData GetActionData(string userAgent, int statusCode)
 {
     return(new DomainActionData
     {
         IsAuthenticated = _authenticator.IsAuthenticated(),
         AnonymousId = _authenticator.GetAnonymousId(),
         UserId = _authenticator.GetUserId(),
         UserEmail = _authenticator.GetUserEmail(),
         UserName = _authenticator.GetUserName(),
         IdentityProvider = _authenticator.GetIdentityProvider(),
         HttpMethod = _httpContextRepository.GetHttpMethod(),
         StatusCode = statusCode,
         Url = _httpContextRepository.GetUrl(),
         UrlReferrer = _httpContextRepository.GetUrlReferrer(),
         UserAgent = userAgent,
         UserHostAddress = _httpContextRepository.GetUserHostAddress(),
         UserHostName = _httpContextRepository.GetUserHostName(),
         UserLanguages = _httpContextRepository.GetUserLanguages()
     });
 }