Esempio n. 1
0
        public void AddQuiz(QuizModel quiz)
        {
            var customers = _context.Set <QuizModel>();

            if (quiz == null)
            {
                return;
            }
            customers.Add(new QuizModel {
                Question = quiz.Question, Answer = quiz.Answer, MaxPoints = quiz.MaxPoints
            });

            _context.SaveChanges();
        }
Esempio n. 2
0
        public void AddPlayer(PlayerModel player)
        {
            if (player == null)
            {
                return;
            }
            var temp = _сontext.Set <PlayerModel>();

            temp.Add(new PlayerModel
            {
                FirstName = player.FirstName,
                LastName  = player.LastName
            });
            _сontext.SaveChanges();
        }