private void CreateExerciseInstance(DateTime date, string exerciseName, int set, int reps, float weight)
 {
     IExerciseInstanceService service = new ExerciseInstanceService(_exerciseInstanceRepository, _exerciseRepository);
     ExerciseInstance exerciseInstance = service.GetByDateTime(date);
     if (exerciseInstance == null)
     {
         exerciseInstance = new ExerciseInstance(date, new Exercise("", exerciseName), set, reps, weight);
         service.Create(exerciseInstance);
     }
 }
Esempio n. 2
0
        private IEnumerable<ExerciseInstance> GetExerciseInstances(long exerciseId)
        {
            var exerciseInstanceService = new ExerciseInstanceService(new ExerciseInstanceRepository(), new ExerciseRepository());
            List<ExerciseInstance> allExerciseInstances = exerciseInstanceService.GetByDates(DateTime.MinValue, DateTime.MaxValue);

            List<ExerciseInstance> exerciseInstances = allExerciseInstances.Where(item => item.Exercise.Id == exerciseId).ToList();

            return exerciseInstances;
        }