コード例 #1
0
        public ArchivedVenueVersionDetailsContract(ArchivedVenueVersion archived, ArchivedVenueVersion comparedVersion, IUserPermissionContext permissionContext)
        {
            ParamIs.NotNull(() => archived);

            ArchivedVersion = new ArchivedVenueVersionContract(archived);
            ComparedVersion = comparedVersion != null ? new ArchivedVenueVersionContract(comparedVersion) : null;
            Venue           = new VenueContract(archived.Entry, permissionContext.LanguagePreference);
            Name            = Venue.Name;

            ComparableVersions = archived.Entry.ArchivedVersionsManager
                                 .GetPreviousVersions(archived, permissionContext)
                                 .Select(a => ArchivedObjectVersionWithFieldsContract.Create(a, a.Diff.ChangedFields.Value, a.CommonEditEvent))
                                 .ToArray();

            Versions = ComparedVenueContract.Create(archived, comparedVersion);

            ComparedVersionId = Versions.SecondId;
        }
コード例 #2
0
        public ArchivedSongVersionDetailsContract(ArchivedSongVersion archived, ArchivedSongVersion comparedVersion, IUserPermissionContext permissionContext)
        {
            ParamIs.NotNull(() => archived);

            ArchivedVersion   = new ArchivedSongVersionContract(archived);
            ComparedVersion   = comparedVersion != null ? new ArchivedSongVersionContract(comparedVersion) : null;
            ComparedVersionId = comparedVersion != null ? comparedVersion.Id : 0;
            Song = new SongContract(archived.Song, permissionContext.LanguagePreference);
            Name = Song.Name;

            ComparableVersions = archived.Song.ArchivedVersionsManager
                                 .GetPreviousVersions(archived, permissionContext)
                                 .Select(a => ArchivedObjectVersionWithFieldsContract.Create(a, a.Diff.ChangedFields.Value, a.Reason))
                                 .ToArray();

            Versions = ComparedSongsContract.Create(archived, comparedVersion);

            ComparedVersionId = Versions.SecondId;
        }
コード例 #3
0
        public ArchivedAlbumVersionDetailsContract(ArchivedAlbumVersion archived, ArchivedAlbumVersion comparedVersion,
                                                   ContentLanguagePreference languagePreference)
        {
            ParamIs.NotNull(() => archived);

            Album           = new AlbumContract(archived.Album, languagePreference);
            ArchivedVersion = new ArchivedAlbumVersionContract(archived);
            ComparedVersion = comparedVersion != null ? new ArchivedAlbumVersionContract(comparedVersion) : null;
            Name            = Album.Name;

            ComparableVersions = archived.Album.ArchivedVersionsManager
                                 .GetPreviousVersions(archived)
                                 .Select(a => ArchivedObjectVersionWithFieldsContract.Create(a, a.Diff.ChangedFields.Value, a.Reason))
                                 .ToArray();

            Versions = ComparedAlbumsContract.Create(archived, comparedVersion);

            ComparedVersionId = Versions.SecondId;
        }
コード例 #4
0
        public ArchivedEventVersionDetailsContract(ArchivedReleaseEventVersion archived, ArchivedReleaseEventVersion comparedVersion, ContentLanguagePreference languagePreference)
        {
            ParamIs.NotNull(() => archived);

            ArchivedVersion   = new ArchivedEventVersionContract(archived);
            ComparedVersion   = comparedVersion != null ? new ArchivedEventVersionContract(comparedVersion) : null;
            ComparedVersionId = comparedVersion != null ? comparedVersion.Id : 0;
            ReleaseEvent      = new ReleaseEventContract(archived.ReleaseEvent, languagePreference);
            Name = ReleaseEvent.Name;

            ComparableVersions = archived.ReleaseEvent.ArchivedVersionsManager
                                 .GetPreviousVersions(archived)
                                 .Select(a => ArchivedObjectVersionWithFieldsContract.Create(a, a.Diff.ChangedFields.Value, a.CommonEditEvent))
                                 .ToArray();

            Versions = ComparedEventsContract.Create(archived, comparedVersion);

            ComparedVersionId = Versions.SecondId;
        }