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)); }
public bool UpdateGenre(Genre genre) { if (Validate(genre)) { CoreToDataMapperService mapperService = new CoreToDataMapperService(); return(_genreRepository.SaveGenre(mapperService.MapGenreCoreToData(genre))); } return(false); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
public Song GetSong(int id) { CoreToDataMapperService mapperService = new CoreToDataMapperService(); return(mapperService.MapSongDataToCore(_songRepository.GetSong(id))); }
public Genre GetGenre(int id) { CoreToDataMapperService mapperService = new CoreToDataMapperService(); return(mapperService.MapGenreDataToCore(_genreRepository.GetGenre(id))); }
public Album GetAlbum(int id) { CoreToDataMapperService mapperService = new CoreToDataMapperService(); return(mapperService.MapAlbumDataToCore(_albumRepository.GetAlbum(id))); }
public Artist GetArtist(int id) { CoreToDataMapperService mapperService = new CoreToDataMapperService(); return(mapperService.MapArtistDataToCore(_artistRepository.GetArtist(id))); }