コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }