コード例 #1
0
        public void Update(Guid id, Exercise exercise)
        {
            Exercise exerciseToUpdate = exerciseRepository.Get(id);

            if (exercise == null)
            {
                throw new ArgumentException("Invalid guid");
            }

            exerciseToUpdate.Problem = exercise.Problem;
            exerciseToUpdate.Score   = exercise.Score;

            exerciseRepository.Update(exerciseToUpdate);
            exerciseRepository.Save();
        }