Пример #1
0
        public int CreateNewSeason(int numberOfGames, DateTime startDate, DateTime? endDate)
        {
            var season = new Season
            {
                StartDate = startDate,
                EndDate = endDate,
                NumberOfWeeks = numberOfGames
            };

            _seasonRepository.Save(season);

            return season.SeasonId;
        }
Пример #2
0
        public ViewSeasonViewModel(Season season)
        {
            NumberOfWeeks = season.NumberOfWeeks;
            Weeks = new List<Week>();

            for (int i = 0; i < NumberOfWeeks; i++)
            {
                if (season.Weeks.ElementAtOrDefault(i) != null)
                    Weeks.Add(new Week(season.Weeks.ElementAt(i)));
            }

            NewWeek = new Week();
        }