Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,
I could not find how to get all MediaFiles properties mapped from Umbraco IPublishedContent Image.
After mapping only: Id, DocTypeAlias Name, Url
are set. How about size, extension, etc? Do I need to set it up to map manually?
public static object MapImage<T>(IUmbracoMapper mapper, IPublishedContent contentToMapFrom, string propertyName, bool isRecursive) where T : MediaFile, new() { var image = new T(); var content = contentToMapFrom.GetPropertyValue<IPublishedContent>(propertyName, isRecursive); if (content != null) { mapper.Map(content, image); } return image; }
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
MediaFile model and only 4 properties mapped
Hi,
I could not find how to get all MediaFiles properties mapped from Umbraco IPublishedContent Image.
After mapping only: Id, DocTypeAlias Name, Url
are set. How about size, extension, etc? Do I need to set it up to map manually?
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.