void AddSeason() { SeasonViewModel season = new SeasonViewModel(); season.Changed += (o, ea) => IsChanged = true; season.Number = Seasons.Any() ? Seasons.Max(p => p.Number) + 1 : 1; Seasons.Add(season); SelectedSeason = season; }
public void AddSeason(Season newSeason) { int maxSeasonId = 0; if (Seasons.Count > 0) { maxSeasonId = Seasons.Max(s => s.Id) + 1; } newSeason.Id = maxSeasonId; Seasons?.Add(newSeason); }