Exemplo n.º 1
0
 public void AddSingleStatistic(StatisticDTO item)
 {
     using (UsageStatisticsModel db = new UsageStatisticsModel()) {
         db.UsageStatistics.Add(new UsageStatistics(item));
         db.SaveChanges();
     }
 }
Exemplo n.º 2
0
        public void RemoveLastRow()
        {
            using (UsageStatisticsModel db = new UsageStatisticsModel())
            {
                var row = db.UsageStatistics.OrderByDescending(x => x.Time).FirstOrDefault();

                if (row != null)
                {
                    db.UsageStatistics.Remove(row);
                    db.SaveChanges();
                }
            }
        }