Exemplo n.º 1
0
        public bool UpdateQuestionOption(QuestionOptionVM model)
        {
            var qOption = _context.QuestionOption.Find(model.quetionOptionId);

            if (qOption == null)
            {
                throw new Exception("Record not found");
            }

            qOption.QuetionOptionName = model.quetionOptionName;


            return(_context.SaveChanges() > 0);
        }
Exemplo n.º 2
0
        public bool AddQuestionOption(QuestionOptionVM model)
        {
            if (model == null)
            {
                throw new Exception("There is no Entry!");
            }

            var qOption = new QuestionOption
            {
                QuetionOptionName = model.quetionOptionName
            };

            _context.QuestionOption.Add(qOption);

            return(_context.SaveChanges() > 0);
        }