ITimeU.Controllers.TimerController.Index C# (CSharp) Method

Index() private method

private Index ( int id ) : System.Web.Mvc.ActionResult
id int
return System.Web.Mvc.ActionResult
        public ActionResult Index(int id)
        {
            var race = RaceModel.GetById(id);
            ViewBag.RaceName = race.Name;
            TimerModel timer;
            if (race.GetTimerId().HasValue)
                timer = TimerModel.GetTimerById(race.GetTimerId().Value);
            else
            {
                timer = new TimerModel();
                timer.RaceID = id;
            }
            timer.SaveToDb();
            ViewBag.Checkpoints = CheckpointModel.GetCheckpoints(id);
            ViewBag.RaceId = id;
            Session["timer"] = timer;
            return View("Index", timer);
        }