public static Quiz_DTO ConvertQuizTo_DTO(Quiz quiz, ref Quiz_DTO quiz_DTO, IQuizRepo quizRepo)
        {
            quiz_DTO.Id           = quiz.Id;
            quiz_DTO.DifficultyId = quiz.DifficultyId;
            quiz_DTO.Subject      = quiz.Subject;
            quiz_DTO.Description  = quiz.Description;

            var diff = new Difficulty_DTO();

            quiz_DTO.Difficulty = ConvertDifficultyTo_DTO(quiz.Difficulty, ref diff);

            List <Question_DTO> question_DTOs = new List <Question_DTO>();

            //Questions
            foreach (Question question in quiz.Questions)
            {
                var obj = new Question_DTO();
                question_DTOs.Add(ConvertQuestionTo_DTO(question, obj, quizRepo).Result);
            }

            quiz_DTO.Questions = question_DTOs;

            List <Result_DTO> result_DTOs = new List <Result_DTO>();

            //results
            foreach (Result result in quiz.Results)
            {
                var obj = new Result_DTO();
                result_DTOs.Add(ConvertResultTo_DTO(result, ref obj));
            }

            quiz_DTO.Results = result_DTOs;

            return(quiz_DTO);
        }
        public static Quiz ConvertQuizTo_Entity(Quiz_DTO quiz_DTO, ref Quiz quiz)
        {
            quiz.Id           = quiz_DTO.Id;
            quiz.DifficultyId = quiz_DTO.DifficultyId;
            quiz.Description  = quiz_DTO.Description;
            quiz.Subject      = quiz_DTO.Subject;

            return(quiz);
        }