예제 #1
0
 public ActionResult Edit([Bind(Include = "TeamId,TeamName,City,Province,PlayerId,country")] Team team)
 {
     if (ModelState.IsValid)
     {
         db.Entry(team).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(team));
 }
예제 #2
0
 public ActionResult Edit([Bind(Include = "PlayerId,FirstName,LastName,Position")] Player player)
 {
     if (ModelState.IsValid)
     {
         db.Entry(player).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(player));
 }
예제 #3
0
 public ActionResult Edit([Bind(Include = "Id,Name,TeamId,PlayerId")] Country country)
 {
     if (ModelState.IsValid)
     {
         db.Entry(country).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(country));
 }
예제 #4
0
 public ActionResult Edit([Bind(Include = "PlayerId,FirstName,LastName,Position,TeamName")] Player player)
 {
     if (ModelState.IsValid)
     {
         db.Entry(player).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.TeamName = new SelectList(db.Teams, "TeamName", "City", player.TeamName);
     return(View(player));
 }
예제 #5
0
 public void Edit(TEntity entity)
 {
     context.Entry(entity).State = EntityState.Modified;
 }