BolfTracker.Web.Controllers.GameController.Index C# (CSharp) Method

Index() public method

public Index ( int year, int month ) : System.Web.Mvc.ActionResult
year int
month int
return System.Web.Mvc.ActionResult
        public ActionResult Index(int? year, int? month)
        {
            int gamesYear = year.HasValue ? year.Value : DateTime.Today.Year;
            int gamesMonth = month.HasValue ? month.Value : DateTime.Today.Month;

            var games = _gameService.GetGames(gamesMonth, gamesYear);
            var playerGameStatistics = _playerService.GetPlayerGameStatistics(gamesMonth, gamesYear);

            return View(new GamesViewModel(gamesMonth, gamesYear, games, playerGameStatistics));
        }