Umbraco中根据ID获取IPublishedContent

Umbraco中根据ID来获取IPublishedContent 

在Umbraco网站上的 https://our.umbraco.com/documentation/Reference/Templating/Mvc/querying 可以看到基本的信息

这里我们再结合项目开发中情况详细说一下

通常的做法是 

var umbracoHelper = new UmbracoHelper(UmbracoContext.Current);
IPublishedContent content = umbracoHelper.TypedContent(nodeId);

 

posted on 2018-08-31 10:54  新西兰程序员  阅读(233)  评论(0编辑  收藏  举报