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'm trying to remove some of my obsolete old code in a U6 solution I'm upgrading to U7.
I've got various references using the old Media object, created by passing in the ID. How do I do a similar thing in U7 with the new Media object?
I'm looking for something like MediaProvider.LoadMedia(int id) or similar.
Hello,
You can use Umbraco.TypedMedia(id). More info here: http://our.umbraco.org/documentation/Reference/Mvc/querying
Jeroen
Thanks Jeroen!
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
How to load Umbraco.Core.Models.Media by ID
I'm trying to remove some of my obsolete old code in a U6 solution I'm upgrading to U7.
I've got various references using the old Media object, created by passing in the ID. How do I do a similar thing in U7 with the new Media object?
I'm looking for something like MediaProvider.LoadMedia(int id) or similar.
Hello,
You can use Umbraco.TypedMedia(id). More info here: http://our.umbraco.org/documentation/Reference/Mvc/querying
Jeroen
Thanks Jeroen!
is working on a reply...