Пример #1
0
        public static IQueryable <Song> WhereHasArtistParticipationStatus(this IQueryable <Song> query,
                                                                          ArtistParticipationQueryParams queryParams,
                                                                          IEntityLoader <Artist> artistGetter)
        {
            var various       = Model.Helpers.ArtistHelper.VariousArtists;
            var producerRoles = ArtistRoles.Composer | ArtistRoles.Arranger;
            var artistId      = queryParams.ArtistIds.Primary;

            return(EntryWithArtistsQueryableExtender.WhereHasArtistParticipationStatus(new ArtistParticipationQueryParams <Song, ArtistForSong>(query, queryParams, artistGetter,
                                                                                                                                                al => al.AllArtists.Any(a => a.Artist.Id == artistId && !a.IsSupport && ((a.Roles == ArtistRoles.Default) || ((a.Roles & producerRoles) != ArtistRoles.Default)) && a.Song.ArtistString.Default != various),
                                                                                                                                                al => al.AllArtists.Any(a => a.Artist.Id == artistId && (a.IsSupport || ((a.Roles != ArtistRoles.Default) && ((a.Roles & producerRoles) == ArtistRoles.Default)) || a.Song.ArtistString.Default == various))
                                                                                                                                                )));
        }
Пример #2
0
        public static IQueryable <Album> WhereHasArtistParticipationStatus(
            this IQueryable <Album> query, EntryIdsCollection artistIds, ArtistAlbumParticipationStatus participation,
            bool childVoicebanks,
            Func <int, Artist> artistGetter)
        {
            var various       = Model.Helpers.ArtistHelper.VariousArtists;
            var producerRoles = ArtistRoles.Composer | ArtistRoles.Arranger;
            var artistId      = artistIds.Primary;

            return(EntryWithArtistsQueryableExtender.WhereHasArtistParticipationStatus(new ArtistParticipationQueryParams <Album, ArtistForAlbum>(query, artistIds, participation,
                                                                                                                                                  childVoicebanks, artistGetter,
                                                                                                                                                  al => al.AllArtists.Any(a => a.Artist.Id == artistId && !a.IsSupport && ((a.Roles == ArtistRoles.Default) || ((a.Roles & producerRoles) != ArtistRoles.Default)) && a.Album.ArtistString.Default != various),
                                                                                                                                                  al => al.AllArtists.Any(a => a.Artist.Id == artistId && (a.IsSupport || ((a.Roles != ArtistRoles.Default) && ((a.Roles & producerRoles) == ArtistRoles.Default)) || a.Album.ArtistString.Default == various))
                                                                                                                                                  )));
        }