public IActionResult Add([FromQuery] StudentQuestionAnswerViewModel model) { var StudentQuestionResponse = _StudentQuestionService.Add(new StudentQuestionAnswer { StudentId = model.StudentId, QuestionId = model.QuestionId, AnswerId = model.AnswerId }); if (StudentQuestionResponse.IsSucceeded && StudentQuestionResponse.Result != null) { return(Ok(StudentQuestionResponse.Result)); } return(StudentQuestionResponse.HttpGetResponse()); }
public IActionResult Edit(int id, StudentQuestionAnswerViewModel model) { var getStudentQuestion = _StudentQuestionService.GetStudentQuestionAnswerById(id); if (getStudentQuestion != null && getStudentQuestion.IsSucceeded) { getStudentQuestion.Result.StudentId = model.StudentId; var updateResult = _StudentQuestionService.Update(getStudentQuestion.Result); if (updateResult.IsSucceeded) { return(Ok(updateResult.Result)); } return(updateResult.HttpGetResponse()); } return(getStudentQuestion.HttpGetResponse()); }