public virtual FavoriteSongForUser AddSongToFavorites(Song song, SongVoteRating rating) { ParamIs.NotNull(() => song); var link = new FavoriteSongForUser(this, song, rating); FavoriteSongs.Add(link); song.UserFavorites.Add(link); if (rating == SongVoteRating.Favorite) { song.FavoritedTimes++; } song.RatingScore += FavoriteSongForUser.GetRatingScore(rating); return(link); }
public void AddFavoriteSong(Song song) { FavoriteSongs.Add(song); DBManager.AddSong(song, "_FavoriteSongs_"); }