예제 #1
0
        public Season(CategoryDTO cat, Team team)
        {
            seasonId   = cat.CategoryId;
            owningTeam = team;

            //this method of making a season doesn't have a year, so we just choose the first year listed in the name
            int yearInt;

            int.TryParse(cat.Name.Substring(0, 4), out yearInt);
            year = yearInt;

            name  = cat.Name;
            games = new BindableCollection <Game>();
            foreach (CategoryDTO subCat in cat.SubCategories)
            {
                games.Add(Game.FromDTO(subCat));
            }
        }