ArmedCards.Web.Controllers.Game.Listing.ValidatePassphraseController.Index C# (CSharp) Метод

Index() приватный Метод

private Index ( int id, string passphrase, Entities playerType ) : System.Web.Mvc.JsonResult
id int
passphrase string
playerType Entities
Результат System.Web.Mvc.JsonResult
        public JsonResult Index(int id, string passphrase, Entities.Enums.GamePlayerType playerType)
        {
            bool validated = false;

            validated = _validatePassphrase.Execute(id, passphrase);

            string key = string.Format("Game_{0}_Passphrase", id);

            if (validated && !string.IsNullOrWhiteSpace(passphrase))
            {
                Session.Add(key, MachineKey.Protect(Encoding.ASCII.GetBytes(passphrase), Session.SessionID));
            }

            string url = Url.Action("Index", "Game", new { id = id });

            if (playerType == Entities.Enums.GamePlayerType.Spectator)
            {
                url = Url.Action("Spectate", "Game", new { id = id });
            }

            return Json(new { Validated = validated, URL = url });
        }
ValidatePassphraseController