Example #1
0
    public async Task <ActionResult <ChoiceResponse> > Post(int quizId, int questionId, ChoiceCreateRequest request)
    {
        var createResponse = await _choiceService.Create(quizId, questionId, request);

        if (!createResponse.Success)
        {
            return(BadRequest(createResponse.Errors));
        }

        return(CreatedAtAction(nameof(Get), createResponse.Object));
    }