public async Task <QuizQuestion> Create(QuizQuestionCreate questionIn) { var question = QuizQuestion.FromCreate(questionIn); await _quizQuestions.InsertOneAsync(question); return(question); }
public async Task <ActionResult <LabGroup> > Create([FromHeader] string authToken, QuizQuestionCreate create) { if (!await _authenticationService.CheckAccess(authToken, "userMgr")) { return(Unauthorized()); } QuizQuestion created = await _quizQuestionService.Create(create); await _logService.Create(new Log( null, AuthenticationHelpers.GetUserIdFromToken(authToken), DateTime.UtcNow, "Quiz Question created.", "quizQuestions", created.Id, JsonSerializer.Serialize(created) )); return(Ok(created)); }