public async Task <IActionResult> PutNation(int id, Nation nation) { if (id != nation.NationId) { return(BadRequest()); } _context.Entry(nation).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!NationExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutAsset(int id, Asset asset) { if (id != asset.AssetId) { return(BadRequest()); } _context.Entry(asset).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AssetExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutEventParticipant(int id, EventParticipant eventParticipant) { if (id != eventParticipant.EventParticipantId) { return(BadRequest()); } _context.Entry(eventParticipant).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EventParticipantExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutBranch(int id, Branch branch) { if (id != branch.BranchId) { return(BadRequest()); } _context.Entry(branch).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BranchExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public ActionResult Edit(Enemy enemy) { if (ModelState.IsValid) { db.Entry(enemy).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(enemy)); }
public void Update(EditData edit) { db.Entry(edit).State = EntityState.Modified; }
public void Update(Article article) { db.Entry(article).State = EntityState.Modified; }