I am trying to refactor a razor script call into a stringly typed model. Here's the model...
using Ministry.Ministryweb.Models;
namespace Ministry.Ministryweb.ViewModels { /// <summary> /// A model for the tem member card partial view. /// </summary> public class TeamMemberCardViewModel : MinistrywebBaseViewModel<TeamMember> { public TeamMemberCardViewModel(dynamic content) { InnerObject = new TeamMember(content); }
public string JobTitle { get { return InnerObject.JobTitle; } } public string Email { get { return InnerObject.Email; } } public string Mobile { get { return InnerObject.Mobile; } } public int AvatarId { get { return InnerObject.AvatarNodeId; } } } }
I would, ideally, like to move this bit of code...
@Umbraco.Media(Model.AvatarId).umbracoFile
...into the model so, rather than exposing the ID, the model just exposes the URL. How can I get access to the umbracoFile property (The Media URL) without the UmbracoHelper?
Getting a Media Url in Backend API Code (U4.11)
I am trying to refactor a razor script call into a stringly typed model. Here's the model...
And the razor script is using it thusly...
I would, ideally, like to move this bit of code...
...into the model so, rather than exposing the ID, the model just exposes the URL. How can I get access to the umbracoFile property (The Media URL) without the UmbracoHelper?
is working on a reply...