public ActionResult Edit([Bind(new [] { "Id", "Name", "Token", "Tagline", "Url" })] Clan Clan) { if (ModelState.IsValid) { var t = db.Clans.Single(x => x.Id == Clan.Id); t.Name = Clan.Name; t.Token = Clan.Token; t.Tagline = Clan.Tagline; t.Url = Clan.Url; db.Entry(t).SetState(Microsoft.Data.Entity.EntityState.Modified); db.SaveChanges(); return(RedirectToAction("IndexAdmin")); } return(View(Clan)); }
public async Task <IActionResult> DeleteConfirmed(int id) { var teamTournament = await db.TeamTournament.SingleAsync(x => x.Id == id); db.TeamTournament.Remove(teamTournament); db.SaveChanges(); return(RedirectToAction("Manage", "Clan")); }