0

I have some trouble accessing Umbraco 7 Content from a UmbracoApiController.

This is my ApiController, with sample data, and i want to get real data from the Umbraco Content. How can i access the Umbraco Content? enter image description here

This is how my Content is structured. enter image description here

The solution if further readers would like to know, with help from http://creativewebspecialist.co.uk/2013/07/16/why-i-think-your-doing-it-wrong-umbraco-alttemplate-data-views/comment-page-1/ enter image description here

user1906437
  • 233
  • 2
  • 6
  • 12

1 Answers1

-1

You can access it using Umbracos Content Service.

Services.ContentService.GetById(nodeId);

You can access the media nodes in a similar way using the MediaService. Hope this helps.

Asher
  • 393
  • 3
  • 16
  • Thx for the answer, i used "Umbraco.TypedContent(umbNodeId)", haven't tried with ContentService. – user1906437 Feb 20 '15 at 09:07
  • The ContentService hits the database, using the helpers as per the above comment will be much quicker and more efficient by using the cached data. – ProNotion Nov 23 '16 at 13:01