Esempio n. 1
0
        public int IncreaseCount()
        {
            CountModel count = _context.CountNumbers.FirstOrDefault();

            if (count == null)
            {
                count = _context.CountNumbers.Add(new CountModel {
                    Count = 0
                });
                _context.SaveChanges();
            }

            if (count.Count < 10)
            {
                count.Count += 1;
                _context.SaveChanges();
            }

            return(count.Count);
        }
Esempio n. 2
0
 public void SaveData()
 {
     _iCounterDbContext.SaveChanges();
     //counterDbContext.SaveChanges();
 }