本文整理匯總了C#中Umbraco.Web.Routing.PublishedContentRequest.PrepareAsync方法的典型用法代碼示例。如果您正苦於以下問題:C# PublishedContentRequest.PrepareAsync方法的具體用法?C# PublishedContentRequest.PrepareAsync怎麽用?C# PublishedContentRequest.PrepareAsync使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Umbraco.Web.Routing.PublishedContentRequest
的用法示例。
在下文中一共展示了PublishedContentRequest.PrepareAsync方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: RouteUmbracoContentAsync
internal async Task<bool> RouteUmbracoContentAsync(UmbracoContext umbCtx, PublishedContentRequest pcr, RouteData routeData)
{
//Initialize the context, this will be called a few times but the initialize logic
// only executes once. There might be a nicer way to do this but the RouteContext and
// other request scoped instances are not available yet.
umbCtx.Initialize(pcr);
//Prepare the request if it hasn't already been done
if (pcr.IsPrepared == false)
{
if (await pcr.PrepareAsync(routeData))
{
if (umbCtx.HasContent == false) return false;
}
}
return umbCtx.HasContent;
}