public void Edit(Song song) { if(song != null) { songRepository.Update(song); } }
public void Add(Song song) { if (song != null) { songRepository.Add(song); } }
private bool IsValid(Song song) { bool isValid = false; if(song == null) return isValid; var isArtistEmpty = String.IsNullOrEmpty(song.Artist); var isTitleEmpty = String.IsNullOrEmpty(song.Title); var isAlbumEmpty = String.IsNullOrEmpty(song.Album); isValid = !(isAlbumEmpty && isArtistEmpty && isTitleEmpty); return isValid; }