Exemple #1
0
 public void CompletePomodoro()
 {
     var date = DateTime.Now.Date;
     var pomodoro = context.Pomodoros.SingleOrDefault(p => p.DateTime == date);
     if (pomodoro == null)
     {
         pomodoro = new PomodoroEntity() { Count = 1, DateTime = date };
         context.Pomodoros.Add(pomodoro);
     }
     else
     {
         pomodoro.Count = pomodoro.Count + 1;
     }
     context.SaveChanges();
 }
Exemple #2
0
        public void CompletePomodoro()
        {
            var date     = DateTime.Now.Date;
            var pomodoro = context.Pomodoros.SingleOrDefault(p => p.DateTime == date);

            if (pomodoro == null)
            {
                pomodoro = new PomodoroEntity()
                {
                    Count = 1, DateTime = date
                };
                context.Pomodoros.Add(pomodoro);
            }
            else
            {
                pomodoro.Count = pomodoro.Count + 1;
            }
            context.SaveChanges();
        }
Exemple #3
0
 public void Add(PomodoroEntity pomodoroEntity)
 {
     context.Pomodoros.Add(pomodoroEntity);
     context.SaveChanges();
 }
Exemple #4
0
 public void Add(PomodoroEntity pomodoroEntity)
 {
     context.Pomodoros.Add(pomodoroEntity);
     context.SaveChanges();
 }