public async Task <IActionResult> Create([Bind("Id,Content,SecretCode")] Question question) { if (ModelState.IsValid) { _context.Add(question); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(question)); }
public async Task <IActionResult> Create([Bind("Id,Content")] Answer answer) { if (ModelState.IsValid) { _context.Add(answer); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(answer)); }
public virtual T Add(T entity) { return(context.Add(entity).Entity); }