Exemplo n.º 1
0
        public async Task <ActionResult <Game> > SaveGame(Game item)
        {
            _context.Games.Add(item);
            await _context.SaveChangesAsync();

            return(CreatedAtAction(nameof(GetById), new { id = item.Id }, item));
        }
Exemplo n.º 2
0
        public async Task <ActionResult <List <Question> > > PostAllQuestions(Question[] questions)
        {
            foreach (Question q in questions)
            {
                _context.Questions.Add(q);
            }
            await _context.SaveChangesAsync();

            return(Ok());
        }