public static ArchivedArtistVersion Create(Artist artist, ArtistDiff diff, AgentLoginData author, ArtistArchiveReason reason, string notes)
        {
            var contract = new ArchivedArtistContract(artist, diff);
            var data     = XmlHelper.SerializeToXml(contract);

            return(artist.CreateArchivedVersion(data, diff, author, reason, notes));
        }
Beispiel #2
0
        public virtual ArchivedArtistVersion CreateArchivedVersion(XDocument data, ArtistDiff diff, AgentLoginData author, ArtistArchiveReason reason, string notes)
        {
            var archived = new ArchivedArtistVersion(this, data, diff, author, Version, Status, reason, notes);

            ArchivedVersionsManager.Add(archived);
            Version++;

            return(archived);
        }
        public ArchivedArtistContract(Artist artist, ArtistDiff diff)
        {
            ParamIs.NotNull(() => artist);

            Albums = (diff.IncludeAlbums ? artist.Albums.Select(a => new ObjectRefContract(a.Album)).ToArray() : null);
            ArtistType = artist.ArtistType;
            Id = artist.Id;
            Description = (diff.IncludeDescription ? artist.Description : null);
            Groups = artist.Groups.Select(g => new ObjectRefContract(g.Group)).ToArray();
            Members = artist.Members.Select(m => new ObjectRefContract(m.Member)).ToArray();
            Names = (diff.IncludeNames ? artist.Names.Names.Select(n => new LocalizedStringContract(n)).ToArray() : null);
            Pictures = (diff.IncludePictures ? artist.Pictures.Select(p => new ArchivedEntryPictureFileContract(p)).ToArray() : null);
            TranslatedName = new TranslatedStringContract(artist.TranslatedName);
            WebLinks = (diff.IncludeWebLinks ? artist.WebLinks.Select(l => new ArchivedWebLinkContract(l)).ToArray() : null);
        }
Beispiel #4
0
        public ArchivedArtistVersion(Artist artist, XDocument data, ArtistDiff diff, AgentLoginData author, int version, EntryStatus status,
                                     ArtistArchiveReason reason, string notes)
            : base(data, author, version, status, notes)
        {
            ParamIs.NotNull(() => data);

            Artist = artist;
            Diff   = diff;
            Reason = reason;

            if (diff.IncludePicture)
            {
                Picture = artist.Picture;
            }
        }