BolfTracker.Web.Controllers.ShotController.Create C# (CSharp) Méthode

Create() private méthode

private Create ( System.Web.Mvc.FormCollection collection ) : System.Web.Mvc.ActionResult
collection System.Web.Mvc.FormCollection
Résultat System.Web.Mvc.ActionResult
        public ActionResult Create(FormCollection collection)
        {
            int gameId = Convert.ToInt32(collection["Game.Id"]);
            int playerId = Convert.ToInt32(collection["Player"]);
            int holeId = Convert.ToInt32(collection["Hole"]);
            int attempts = Convert.ToInt32(collection["attempts"]);
            bool shotMade = collection["shotMade"] == "on" ? true : false;

            _shotService.Create(gameId, playerId, holeId, attempts, shotMade);

            return RedirectToAction("Details", "Game", new { id = gameId });
        }