Exemplo n.º 1
0
        public async Task <Question> AddQuestionAsync(Question question)
        {
            try
            {
                var result = _context.Questions.AddAsync(question);
                await _context.SaveChangesAsync();

                return(question);
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.InnerException.Message);
                return(null);
            }
        }
Exemplo n.º 2
0
        public async Task <Score> AddScoreAsync(Score score)
        {
            try
            {
                var result = _context.Scores.AddAsync(score);
                await _context.SaveChangesAsync();

                return(score);
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.InnerException.Message);
                return(null);
            }
        }
        public async Task <Answer> AddAnswerAsync(Answer answer)
        {
            try
            {
                await _context.Answers.AddAsync(answer);

                await _context.SaveChangesAsync();

                return(answer);
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.InnerException.Message);
                return(null);
            }
        }