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
I might be the only person out there who was using the mediaextensions!
I was wondering why methods like uQueryExtensions.MediaExtensions.GetPropertyAsString() have been removed between versions? Are there better alternatives for getting properties from my custom media types?
I didn't realise they had been removed ! That was unintentional - some methods were marked as obsolete (but should never be removed as that'd be a breaking change in an API). The idea for marking them as obsolete was to suggest the use of the genereric .GetProperty<T>("propertyAlias") method instead.
ahhh no worries, I just rolled back for now. Will probably update the references in my source when the GetProperty<T>() is added instead. Thanks for responding so quickly!
I've just checked the 3.0.3 dll and all the methods are still there *phew* (so no breaking changes).
I wonder if the confusion has stemmed from the extension methods being moved up the object model hierarachy to extend the Content class (which Media inherits from) ?
Probably, I didn't investigate terribly thoroughly, I just wanted to get it to work, but I did get errors when I was calling those methods on a media object.
string title = new Media(selectedFeatureImage.Id).GetPropertyAsString("featureTitle");
I will check it again later.
We found that we had duplicate "GetPropertyAs[whatever] methods for Document, Media and Members... since they all inherit from the Content object, we move the extension methods to there.
Your last code snippet *should* still work ... but if you are getting errors, let us know what they are ... we'll sort this out for a 3.0.4 patch.
Checked again. When I update the version of uComponents on my site I get the following error:
Method not found: 'System.String uComponents.Core.uQueryExtensions.MediaExtensions.GetPropertyAsString(umbraco.cms.businesslogic.media.Media, System.String)'.
Doesn't seem to be a big deal as updating the reference in my project and rebuilding results in everything working fine!
Had a poke around the DLL too, makes much more sense for the extensions to be on the Content object anyway. Thanks for your help chaps.
Sorry about forcing the rebuild... didn't realise that it would have that impact, (although seems obvious now - doh!)
Damn, this meant that change should have bumped the version number up to v3.1.0 (we're *trying* to follow SemVer now)
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted