public FileResourcePhoto(ProjectImage projectImage) { EntityImageIDAsNullable = projectImage.ProjectImageID; PrimaryKey = projectImage.ProjectImageID; FileResourceInfo = projectImage.FileResourceInfo; DeleteUrl = projectImage.GetDeleteUrl(); IsKeyPhoto = projectImage.IsKeyPhoto; Caption = projectImage.Caption; CaptionOnFullView = projectImage.GetCaptionOnFullView(); CaptionOnGallery = projectImage.GetCaptionOnGallery(); PhotoUrl = projectImage.GetPhotoUrl(); PhotoUrlScaledThumbnail = projectImage.GetPhotoUrlScaledThumbnail(); EditUrl = projectImage.GetEditUrl(); AdditionalCssClasses = new List <string>(); }
public static string GetCaptionOnFullView(this ProjectImage projectImage) { var creditString = string.IsNullOrWhiteSpace(projectImage.Credit) ? string.Empty : $"\r\nCredit: {projectImage.Credit}"; return($"{projectImage.GetCaptionOnGallery()}{creditString}"); }