public EntryReportContract(EntryReport report, ContentLanguagePreference languagePreference) { ParamIs.NotNull(() => report); Created = report.Created; Entry = new EntryRefWithNameContract(report.EntryBase, languagePreference); Hostname = report.Hostname; Id = report.Id; Notes = report.Notes; User = (report.User != null ? new UserWithEmailContract(report.User) : null); }
public EntryReportContract(EntryReport report, EntryForApiContract entry, IEnumTranslations enumTranslations) { ParamIs.NotNull(() => report); Created = report.Created; Entry = entry; Hostname = report.Hostname; Id = report.Id; Notes = report.Notes; ReportTypeName = enumTranslations != null?report.TranslatedReportTypeName(enumTranslations) : null; User = (report.User != null ? new UserWithEmailContract(report.User) : null); Version = (report.VersionBase != null ? new ArchivedObjectVersionContract(report.VersionBase) : null); }
public EntryReportContract(EntryReport report, EntryForApiContract entry, IEnumTranslations enumTranslations, IUserIconFactory userIconFactory) { ParamIs.NotNull(() => report); ClosedAt = report.ClosedAt; ClosedBy = report.ClosedBy != null ? new UserForApiContract(report.ClosedBy, userIconFactory, UserOptionalFields.MainPicture) : null; Created = report.Created; Entry = entry; Hostname = report.Hostname; Id = report.Id; Notes = report.Notes; ReportTypeName = enumTranslations != null?report.TranslatedReportTypeName(enumTranslations) : null; User = (report.User != null ? new UserForApiContract(report.User, userIconFactory, UserOptionalFields.MainPicture) : null); Version = (report.VersionBase != null ? new ArchivedObjectVersionContract(report.VersionBase) : null); }
public EntryReportContract Create(EntryReport report, ContentLanguagePreference languagePreference) { if (report is AlbumReport) { return(new EntryReportContract((AlbumReport)report, languagePreference)); } if (report is ArtistReport) { return(new EntryReportContract((ArtistReport)report, languagePreference)); } if (report is SongReport) { return(new EntryReportContract((SongReport)report, languagePreference)); } return(new EntryReportContract(report, languagePreference)); }