Esempio n. 1
0
        public async Task <IActionResult> Create([Bind("QuestionId,QuestionText,ans1,ans2,ans3,ans4,cans,sid")] Question question)
        {
            if (ModelState.IsValid)
            {
                _context.Add(question);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(question));
        }
Esempio n. 2
0
        public async Task <IActionResult> Create([Bind("SubjectId,SubjectName,CreatedDate,UpdatedDate")] Subject subject)
        {
            if (ModelState.IsValid)
            {
                _context.Add(subject);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(subject));
        }