public ActionResult Index(string userName, string guessedName) { if (Request.IsAuthenticated) userName = System.Web.HttpContext.Current.User.Identity.Name; if (IsErrorInPost(userName, guessedName)) return View(); ViewBag.YourName = userName; ViewBag.GuessedName = guessedName; var theName = new TheName(); ViewBag.GuessResult = theName.MakeGuess(userName, guessedName); return Index(); }
//http://mvcguessmysonsname.apphb.com/ //http://mvcguessmysonsname.apphb.com/api/names/getisname?name=x // GET api/names/getisname?name= public bool GetIsName(string name) { var theName = new TheName(); return theName.MakeGuess(name); }