public async Task <T> Create(T entity) { var result = (await _dbSet.AddAsync(entity)).Entity; await _context.SaveChangesAsync(); return(result); }
public async Task <IActionResult> Create([Bind("Id,SubmissionDate,Content")] Decision decision) { if (ModelState.IsValid) { _context.Add(decision); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(decision)); }
public async Task <IActionResult> ClearAllTagRelations() { var dgs = _context.DecisionTags.ToList(); foreach (var dg in dgs) { _context.DecisionTags.Remove(dg); } await _context.SaveChangesAsync(); return(RedirectToAction("Index")); }