public ArtistForUserContract(OwnedArtistForUser ownedArtistForUser, ContentLanguagePreference languagePreference) { ParamIs.NotNull(() => ownedArtistForUser); Artist = new ArtistContract(ownedArtistForUser.Artist, languagePreference); Id = ownedArtistForUser.Id; User = new UserContract(ownedArtistForUser.User); }
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; }
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); }
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); }