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); }
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); }