internal static Season DeepCopy(Season seasonAndGame) { Season returnSeason = new Season {name = seasonAndGame.name, seasonId = seasonAndGame.seasonId, owningTeam = seasonAndGame.owningTeam, year = seasonAndGame.year }; foreach (Game g in seasonAndGame.games) { Game newGame = new Game { date = g.date, gameId = g.gameId, opponent = g.opponent }; foreach (Category c in g.categories) { Category newCategory = new Category { categoryId = c.categoryId, name = c.name }; foreach (Playlist p in c.playlists) { newCategory.playlists.Add(Playlist.Copy(p)); } newGame.categories.Add(newCategory); } returnSeason.games.Add(newGame); } return returnSeason; }
public CategoryViewModel(Category cat) { CategoryModel = cat; Playlists = new BindableCollection<PlaylistViewModel>(); }
public static Category FromDTO(CategoryDTO categoryDTO) { Category category = new Category(); category.categoryId = categoryDTO.CategoryId; category.name = categoryDTO.Name; return category; }