Exemplo n.º 1
0
 public ActionResult RenamePlayer(RenamePlayerModel model, Player p)
 {
     using (var db = new MetinEntities())
     {
         var player = db.Players.SingleOrDefault(x => x.Id == p.Id);
         player.Name = model.NewName;
         db.SaveChanges();
         return(RedirectToAction("AccountDetails", new { id = player.Account.Id }));
     }
 }
Exemplo n.º 2
0
 public ActionResult RenamePlayer(int id)
 {
     using (var db = new MetinEntities())
     {
         var player = db.Players.SingleOrDefault(x => x.Id == id);
         var ret    = new RenamePlayerModel {
             Player = player
         };
         return(View(ret));
     }
 }