コード例 #1
0
 public WCFWebServiceJson()
 {
     SqlAccountRepository = new SqlAccountRepository(ConnectionString);
     SqlAlbumRepository = new SqlAlbumRepository(ConnectionString);
     SqlAlbumGenreRepository = new SqlAlbumGenreRepository(ConnectionString);
     SqlAlbumSongRepository = new SqlAlbumSongRepository(ConnectionString);
     SqlArtistRepository = new SqlArtistRepository(ConnectionString);
     SqlArtistAlbumRepository = new SqlArtistAlbumRepository(ConnectionString);
     SqlArtistGenreRepository = new SqlArtistGenreRepository(ConnectionString);
     SqlBusinessTypeRepository = new SqlBusinessTypeRepository(ConnectionString);
     SqlBusinessUserRepository = new SqlBusinessUserRepository(ConnectionString);
     SqlCountyCityRepository = new SqlCountyCityRepository(ConnectionString);
     SqlGenreRepository = new SqlGenreRepository(ConnectionString);
     SqlMediaAssetFormatRepository = new SqlMediaAssetFormatRepository(ConnectionString);
     SqlMediaAssetLocationRepository = new SqlMediaAssetLocationRepository(ConnectionString);
     SqlMediaAssetRepository = new SqlMediaAssetRepository(ConnectionString);
     SqlMediaAssetTypeRepository = new SqlMediaAssetTypeRepository(ConnectionString);
     SqlPlaylistRepository = new SqlPlaylistRepository(ConnectionString);
     SqlPlaylistSongRepository = new SqlPlaylistSongRepository(ConnectionString);
     SqlProtocolRepository = new SqlProtocolRepository(ConnectionString);
     SqlPurchasedSongRepository = new SqlPurchasedSongRepository(ConnectionString);
     SqlSongRepository = new SqlSongRepository(ConnectionString);
     SqlSongGenreRepository = new SqlSongGenreRepository(ConnectionString);
     SqlSongMediaAssetRepository = new SqlSongMediaAssetRepository(ConnectionString);
     SqlUserRepository = new SqlUserRepository(ConnectionString);
     SqlUserPlaylistRepository = new SqlUserPlaylistRepository(ConnectionString);
 }
コード例 #2
0
        private List<Album> GetArtistAlbumCollection(int userId)
        {
            var artistAlbumRepository = new SqlArtistAlbumRepository(ConnectionString);
            var albumRepository = new SqlAlbumRepository(ConnectionString);

            var userAlbums = artistAlbumRepository.GetArtistAlbumsByArtistId(userId);
            var albums = userAlbums.Select(userAlbum => albumRepository.Album.FirstOrDefault(x => x.AlbumId == userAlbum.AlbumId)).ToList();

            return albums;
        }