/// <summary> /// Returns the photo for a card, depending on the gender, reverting to a default one if unspecified. /// </summary> string GetPhoto(string actual, bool gender) { var defaultPhoto = gender ? "~/assets/img/unknown-male.png" : "~/assets/img/unknown-female.png"; var photo = StringHelper.Coalesce(MediaPresenterService.GetSizedMediaPath(actual, MediaSize.Small), defaultPhoto); return(_url.Content(photo)); }
/// <summary> /// Maps a page excerpt to the page title. /// </summary> private PageTitleExtendedVM Map(RelationContext.PageExcerpt page) { return(new PageTitleExtendedVM { Id = page.Id, Key = page.Key, Title = page.Title, Type = page.Type, MainPhotoPath = MediaPresenterService.GetSizedMediaPath(page.MainPhotoPath, MediaSize.Small) }); }