public async Task <ActionResult <IEnumerable <Quiz> > > GetQuizzes()
        {
            //1. enititeiten ophaln
            var model = await quizRepo.GetQuizzesAsync();


            //2. Mapping naar DTO
            List <Quiz_DTO> dTOs = new List <Quiz_DTO>();

            foreach (Quiz item in model)
            {
                var result = new Quiz_DTO();
                dTOs.Add(Mapper.ConvertTo_DTOAsync(item, ref result, subjectRepo));
            }
            return(Ok(dTOs));
        }
Exemple #2
0
        public async Task <ActionResult> IndexAsync()
        {
            var quizzes = await quizRepo.GetQuizzesAsync();

            return(View(quizzes));
        }