Пример #1
0
        public ArtistForUserContract(OwnedArtistForUser ownedArtistForUser, ContentLanguagePreference languagePreference)
        {
            ParamIs.NotNull(() => ownedArtistForUser);

            Artist = new ArtistContract(ownedArtistForUser.Artist, languagePreference);
            Id = ownedArtistForUser.Id;
            User = new UserContract(ownedArtistForUser.User);
        }
Пример #2
0
        public virtual bool Equals(OwnedArtistForUser another)
        {
            if (another == null)
                return false;

            if (ReferenceEquals(this, another))
                return true;

            if (Id == 0)
                return false;

            return this.Id == another.Id;
        }
Пример #3
0
        public virtual OwnedArtistForUser AddOwnedArtist(Artist artist)
        {
            ParamIs.NotNull(() => artist);

            var old = ownedArtists.FirstOrDefault(a => a.Artist.Equals(artist));

            if (old != null)
            {
                throw new ArgumentException("Unable to add the same artist again", "artist");
            }

            var link = new OwnedArtistForUser(this, artist);

            AllOwnedArtists.Add(link);
            artist.OwnerUsers.Add(link);

            return(link);
        }
Пример #4
0
        public virtual bool Equals(OwnedArtistForUser another)
        {
            if (another == null)
            {
                return(false);
            }

            if (ReferenceEquals(this, another))
            {
                return(true);
            }

            if (Id == 0)
            {
                return(false);
            }

            return(this.Id == another.Id);
        }