예제 #1
0
        public bool RemoveArtist(int id)
        {
            //to do: later want to make sure we validate there are no songs linked to the artist before we delete
            CoreToDataMapperService mapperService = new CoreToDataMapperService();

            return(_artistRepository.RemoveArtist(id));
        }
예제 #2
0
 public bool UpdateGenre(Genre genre)
 {
     if (Validate(genre))
     {
         CoreToDataMapperService mapperService = new CoreToDataMapperService();
         return(_genreRepository.SaveGenre(mapperService.MapGenreCoreToData(genre)));
     }
     return(false);
 }
예제 #3
0
 public bool UpdateSong(Song song)
 {
     //only set everything up if our object is valid
     if (Validate(song))
     {
         CoreToDataMapperService mapperService = new CoreToDataMapperService();
         return(_songRepository.UpdateSong(mapperService.MapSongCoreToData(song)));
     }
     return(false);
 }
예제 #4
0
 public bool AddAlbum(Album album)
 {
     //only set everything up if our object is valid
     if (Validate(album))
     {
         CoreToDataMapperService mapperService = new CoreToDataMapperService();
         return(_albumRepository.SaveAlbum(mapperService.MapAlbumCoreToData(album)));
     }
     return(false);
 }
예제 #5
0
 public bool UpdateArtist(Artist artist)
 {
     //only set everything up if our object is valid
     if (Validate(artist))
     {
         CoreToDataMapperService mapperService = new CoreToDataMapperService();
         return(_artistRepository.UpdateArtist(mapperService.MapArtistCoreToData(artist)));
     }
     return(false);
 }
예제 #6
0
        public List <Song> GetSongsByArtist(int artistID)
        {
            List <Song>             songs         = new List <Song>();
            CoreToDataMapperService mapperService = new CoreToDataMapperService();

            foreach (ISong songData in _songRepository.GetSongsByArtist(artistID))
            {
                songs.Add(mapperService.MapSongDataToCore(songData));
            }
            return(songs);
        }
예제 #7
0
        public List <Genre> GetAllGenres()
        {
            List <Genre>            genres        = new List <Genre>();
            CoreToDataMapperService mapperService = new CoreToDataMapperService();

            foreach (IGenre genreData in _genreRepository.GetAllGenres())
            {
                genres.Add(mapperService.MapGenreDataToCore(genreData));
            }
            return(genres);
        }
예제 #8
0
        public List <Album> GetAllAlbums()
        {
            List <Album>            albums        = new List <Album>();
            CoreToDataMapperService mapperService = new CoreToDataMapperService();

            foreach (IAlbum albumData in _albumRepository.GetAllAlbums())
            {
                albums.Add(mapperService.MapAlbumDataToCore(albumData));
            }
            return(albums);
        }
예제 #9
0
        public List <Artist> GetAllArtists()
        {
            List <Artist>           artists       = new List <Artist>();
            CoreToDataMapperService mapperService = new CoreToDataMapperService();

            foreach (IArtist artistData in _artistRepository.GetAllArtists())
            {
                artists.Add(mapperService.MapArtistDataToCore(artistData));
            }
            return(artists);
        }
예제 #10
0
        public Song GetSong(int id)
        {
            CoreToDataMapperService mapperService = new CoreToDataMapperService();

            return(mapperService.MapSongDataToCore(_songRepository.GetSong(id)));
        }
예제 #11
0
        public Genre GetGenre(int id)
        {
            CoreToDataMapperService mapperService = new CoreToDataMapperService();

            return(mapperService.MapGenreDataToCore(_genreRepository.GetGenre(id)));
        }
예제 #12
0
        public Album GetAlbum(int id)
        {
            CoreToDataMapperService mapperService = new CoreToDataMapperService();

            return(mapperService.MapAlbumDataToCore(_albumRepository.GetAlbum(id)));
        }
예제 #13
0
        public Artist GetArtist(int id)
        {
            CoreToDataMapperService mapperService = new CoreToDataMapperService();

            return(mapperService.MapArtistDataToCore(_artistRepository.GetArtist(id)));
        }