private static BaseItem UnknownItem(IndexType indexType) { const string unknown = "<Unknown>"; switch (indexType) { case IndexType.Director: case IndexType.Actor: return(Person.GetPerson(unknown)); case IndexType.Studio: return(Studio.GetStudio(unknown)); case IndexType.Year: return(Year.GetYear(unknown)); default: return(Genre.GetGenre(unknown)); } }
protected virtual Func <string, BaseItem> GetConstructor(string property) { switch (property) { case "Actors": case "Directors": return(a => Person.GetPerson(a)); case "Genres": return(g => Genre.GetGenre(g)); case "ProductionYear": return(y => Year.GetYear(y)); case "Studios": return(s => Studio.GetStudio(s)); default: return(i => GenericItem.GetItem(i)); } }