public static Performer[] GetPerformerByEntertainmentAndRole(Entertainment entertainment, PerformerInEntertainment.Role role) { PerformerInEntertainment[] performerInEntertainments = PerformerInEntertainment.GetPerformerInEntertainmentByEntertainmentAndRole(entertainment, role); if (performerInEntertainments == null) { return(null); } List <Guid> ids = new List <Guid>(); foreach (var performerInEntertainment in performerInEntertainments) { ids.Add(performerInEntertainment.PerformerId); } return(Performer.GetByIds(ids.ToArray())); }
public static Performer[] GetAlbumAuthorsByAlbum(Entertainment entertainment) { lock (_locker) { if (entertainment.EntertainmentType != Entertainment.Type.Album) { return(null); } PerformerInEntertainment[] performerInEntertainments = PerformerInEntertainment.GetAlbumAuthorsPerformerInEntertainmentsByEntertainment(entertainment); if (performerInEntertainments == null) { return(null); } List <Guid> ids = new List <Guid>(); foreach (var performerInEntertainment in performerInEntertainments) { ids.Add(performerInEntertainment.PerformerId); } return(Performer.GetByIds(ids.ToArray())); } }