Esempio n. 1
0
        public void CreateExercisesForNewLesson(lesson lesson)
        {
            int lessonSetupId = _lessonsSetupRepository.GetLessonSetupIdByLessonNumber(lesson.lesson_number);

            foreach (var exerciseSetup in _exercisesSetupRepository.GetExercisesSetupByLessonSetupId(lessonSetupId))
            {
                var exercise = new exercis
                {
                    exercise_number = exerciseSetup.exercise_number,
                    lesson_id       = lesson.id,
                    is_done         = false
                };

                _exerciseRepository.CreateExercise(exercise);
            }
        }
Esempio n. 2
0
 public int GetLessonSetupIdByLessonNumber(int lessonNumber)
 {
     return(_lessonsSetupRepository.GetLessonSetupIdByLessonNumber(lessonNumber));
 }