コード例 #1
0
ファイル: ArtistForSong.cs プロジェクト: sethura/vocadb
        public virtual void Move(Song target)
        {
            ParamIs.NotNull(() => target);

            if (target.Equals(Song))
            {
                return;
            }

            Song.AllArtists.Remove(this);
            Song = target;
            target.AllArtists.Add(this);
        }
コード例 #2
0
        public virtual void Move(Song target)
        {
            ParamIs.NotNull(() => target);

            if (target.Equals(Song))
            {
                return;
            }

            if (Song == null)
            {
                throw new InvalidOperationException("Cannot move a track with no song to another song");
            }

            Song.AllAlbums.Remove(this);
            target.AllAlbums.Add(this);
            Song = target;
        }