예제 #1
0
        public async Task AddQuestionAsync(RoundQuestionDto roundQuestionDto)
        {
            var roundQuestion = new RoundQuestion
            {
                Id         = roundQuestionDto.Id,
                RoundId    = roundQuestionDto.RoundId,
                QuestionId = roundQuestionDto.QuestionId
            };

            await _repositoryRoundQuestion.CreateAsync(roundQuestion);

            await _repositoryRoundQuestion.SaveChangesAsync();
        }
예제 #2
0
        public async Task <IActionResult> AddRoundQuestion([FromBody] IEnumerable <GameContentViewModel> model)
        {
            if (ModelState.IsValid)
            {
                var roundQuestionDto = new RoundQuestionDto
                {
                    //RoundId = model.RoundId,
                    //QuestionId = model.QuestionId
                };

                await _roundQuestionManager.AddQuestionAsync(roundQuestionDto);

                return(View());
            }

            return(View());
        }