예제 #1
0
        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;            
        }
예제 #2
0
        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);
        }