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...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
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...