public CreatedQuizDto CreateQuiz(CreateQuizDto createQuizDto, string userEmail) { var user = GetUserFromEmail(userEmail); createQuizDto.QuizOwnerId = user.Id; var playerIds = createQuizDto.Players.Select(dto => dto.Id); if (playerIds.Contains(createQuizDto.QuizOwnerId)) { return(null); } var addedQuiz = _quizService.AddQuiz(createQuizDto); addedQuiz.QuizRoundDto = createQuizDto.Round; var addedRound = _roundService.AddRoundToQuiz(addedQuiz.QuizRoundDto, addedQuiz.Id); _roundService.InsertUsersIntoTheRoundUserPoints(addedRound.Id, createQuizDto.Players); return(new CreatedQuizDto { Id = addedQuiz.Id, Name = addedQuiz.Name, Date = addedQuiz.Date, PlayerInQuizDtos = createQuizDto.Players }); }