Пример #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));
        }