BolfTracker.Web.Controllers.GameController.Index C# (CSharp) 메소드

Index() 공개 메소드

public Index ( int year, int month ) : System.Web.Mvc.ActionResult
year int
month int
리턴 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));
        }