public async Task <ActionResult> AddAsync(QuizDto quizDto) { var result = await _quizService.AddAsync(quizDto); if (!result.Successeded && result.Data == null) { return(BadRequest(result)); } return(Ok(result)); }
public async Task <object> Post([FromForm] string name, [FromForm] QuestionGroup @group = QuestionGroup.Json) { var result = await _quizService.AddAsync(name, group); int code; if (int.TryParse(result.ToString(), out code)) { return(StatusCode(code)); } return(result); }