You'll have access to the PublishedContentCache through the UmbracoContext property of the controller, this in turn has a 'Content' property that is of type IPublishedContentCache which is where the GetByRoute() method lives:
public class SuperApiController : UmbracoApiController
{
[System.Web.Http.HttpGet]
public IEnumerable<string> GetListOfThings()
{
// here is GetByRoute...
UmbracoContext.Content.GetByRoute();
}
}
Umbraco 8 get by route
Anyone knows where I can find Get By Route content finder? Trying to see what I can do within Umbraco API Controller, but there's no such method?
Hi Tomasz
If your API controller inherits from UmbracoApiController (which in turn inherits UmbracoApiControllerBase)
https://github.com/umbraco/Umbraco-CMS/blob/9c06ef83e217affbce51c1d6682f10914be2b400/src/Umbraco.Web/WebApi/UmbracoApiControllerBase.cs
You'll have access to the PublishedContentCache through the UmbracoContext property of the controller, this in turn has a 'Content' property that is of type IPublishedContentCache which is where the GetByRoute() method lives:
regards
Marc
Face... palm... I should have tried to investigate the methods there, instead of getting stuck on Umbraco.(...) class...
Thank you Marc!
is working on a reply...