Exemplo n.º 1
0
 public string GetMostPopularIpAddress()
 {
     using (var context = new LITIsEpicDataContext(_connectionString))
     {
         return(context.GetFiveMostFrequentIPs().First().IPAddress);
     }
 }
Exemplo n.º 2
0
 public IEnumerable <GetFiveMostFrequentIPsResult> GetFiveMostFrequentIPs()
 {
     using (var context = new LITIsEpicDataContext(_connectionString))
     {
         return(context.GetFiveMostFrequentIPs().ToList());
     }
 }
Exemplo n.º 3
0
 public int GetVisitCountForToday()
 {
     using (var context = new LITIsEpicDataContext(_connectionString))
     {
         return(context.Visits.Count(v => v.Date.Date == DateTime.Today));
     }
 }
Exemplo n.º 4
0
        public void AddVisit(string ipAddress)
        {
            Visit visit = new Visit
            {
                IPAddress = ipAddress,
                Date      = DateTime.Now
            };

            using (var context = new LITIsEpicDataContext(_connectionString))
            {
                context.Visits.InsertOnSubmit(visit);
                context.SubmitChanges();
            }
        }