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...
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
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...
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.