public Player Join(int accountId, string name, int rating) { var result = new Player() { AccountId = accountId, Name = name, Rating = rating }; Join(result); return result; }
public ActionResult Create(Game model) { if (ModelState.IsValid) { GameServer.SaveNewGame(model); model.Join(Account.Id, Account.Name, Account.Rating); GameServer.PlayerJoined(model, Account.Id); return Redirect("/Game-" + model.Id + "/"); } // If we got this far, something failed, redisplay form return View(model); }