public async Task <ActionResult> Edit([Bind(Include = "Id,Name,Gender,City,DateOfBirth,EmailAddress,Score,ProfileUrl,GameMoney,TeamId")] Gamer gamer) { if (ModelState.IsValid) { _db.Entry(gamer).State = EntityState.Modified; await _db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.TeamId = new SelectList(_db.Team, "Id", "Name", gamer.TeamId); return(View(gamer)); }
public ActionResult Edit([Bind(Include = "Id,Name,Email,Gender,City,GameScore,DateOfBirth")] Gamer gamer) { if (ModelState.IsValid) { db.Entry(gamer).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(gamer)); }
public async Task <ActionResult> Edit([Bind(Include = "Id,Name,Gender,EmailAddress")] Gamer gamer) { if (ModelState.IsValid) { db.Entry(gamer).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(gamer)); }