public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.Attach(QuizQuestion).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!QuizQuestionExists(QuizQuestion.Id)) { return(NotFound()); } else { throw; } } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.CanvasProperties.Add(CanvasProperties); await _context.SaveChangesAsync(); return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.QuizQuestions.Add(QuizQuestion); await _context.SaveChangesAsync(); return(RedirectToPage("./Index")); }
public async Task<IActionResult> OnPostAsync(Guid? id) { if (id == null) { return NotFound(); } CanvasProperties = await _context.CanvasProperties.FindAsync(id); if (CanvasProperties != null) { _context.CanvasProperties.Remove(CanvasProperties); await _context.SaveChangesAsync(); } return RedirectToPage("./Index"); }