protected virtual void ExecuteInsertPerformerCommand(string[] commandWords) { switch (commandWords[2]) { case "singer": var singer = new Singer(commandWords[3]); this.InsertPerformer(singer); break; default: break; } }
protected override void ExecuteInsertPerformerCommand(string[] commandWords) { switch (commandWords[2]) { case "singer": var singer = new Singer(commandWords[3]); this.InsertPerformer(singer); break; case "band": var band = new Band(commandWords[3]); this.InsertPerformer(band); break; default: base.ExecuteInsertPerformerCommand(commandWords); break; } }
protected virtual string GetSingerReport(Singer singer) { StringBuilder singerInfo = new StringBuilder(); singerInfo.Append(singer.Name + ": "); if (singer.Songs.Any()) { var songs = singer.Songs .Select(s => s.Title) .OrderBy(s => s); singerInfo.Append(string.Join("; ", songs)); } else { singerInfo.Append("no songs"); } return(singerInfo.ToString()); }
protected virtual string GetSingerReport(Singer singer) { StringBuilder singerInfo = new StringBuilder(); singerInfo.Append(singer.Name + ": "); if (singer.Songs.Any()) { var songs = singer.Songs .Select(s => s.Title) .OrderBy(s => s); singerInfo.Append(string.Join("; ", songs)); } else { singerInfo.Append("no songs"); } return singerInfo.ToString(); }