public async Task <Answer> AddAnswerToQuestion(Answer answer) { try { var result = await _context.Answers.AddAsync(answer); await _context.SaveChangesAsync(); return(answer); } catch (Exception) { throw; } }
public async Task <Question> AddQuestionToQuiz(Question qstn) { try { var result = await _context.Questions.AddAsync(qstn); await _context.SaveChangesAsync(); return(qstn); } catch (Exception) { throw; } }
//create public async Task <Quiz> AddQuizAsync(Quiz quiz) { try { var result = await _context.Quizzes.AddAsync(quiz); await _context.SaveChangesAsync(); return(quiz); } catch (Exception ex) { Debug.WriteLine(ex.InnerException.Message); return(null); } }
public async Task <Scores> AddScoreAsync(Scores score) { try { var reslust = await _context.Scores.AddAsync(score); await _context.SaveChangesAsync(); return(score); } catch (Exception) { throw; } }