예제 #1
0
        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));
        }
예제 #2
0
 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));
 }
예제 #3
0
        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));
        }