public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Keywords,Fund,Bid,Town,Status,Radius")] Campaign1 campaign1) { if (id != campaign1.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(campaign1); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!Campaign1Exists(campaign1.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(campaign1)); }
public void Update <T>(T entity) where T : class { _context.Update(entity); }